Getting Data In

Sending logs to splunk using python script

VijaySrrie
Builder

Hi,

Is there a way to send logs to splunk using python script? Can you please send me the sample script?

Tags (1)
0 Karma
1 Solution

mydog8it
Builder

Here is a link to the scripted input documentation:
https://docs.splunk.com/Documentation/SplunkCloud/latest/AdvancedDev/ScriptSetup

If you read through the documentation to the third page there is a sample script to poll a database for data to send to Splunk.

You could also use a python script to write a local text file and have the Universal Forwarder pick it up and send to Splunk. If you attempt this method be sure to include logic that cleans up the local logging file over time or you can consume the drive space.

View solution in original post

0 Karma

mydog8it
Builder

Here is a link to the scripted input documentation:
https://docs.splunk.com/Documentation/SplunkCloud/latest/AdvancedDev/ScriptSetup

If you read through the documentation to the third page there is a sample script to poll a database for data to send to Splunk.

You could also use a python script to write a local text file and have the Universal Forwarder pick it up and send to Splunk. If you attempt this method be sure to include logic that cleans up the local logging file over time or you can consume the drive space.

0 Karma
Get Updates on the Splunk Community!

Earn a $35 Gift Card for Answering our Splunk Admins & App Developer Survey

Survey for Splunk Admins and App Developers is open now! | Earn a $35 gift card!      Hello there,  Splunk ...

Continuing Innovation & New Integrations Unlock Full Stack Observability For Your ...

You’ve probably heard the latest about AppDynamics joining the Splunk Observability portfolio, deepening our ...

Monitoring Amazon Elastic Kubernetes Service (EKS)

As we’ve seen, integrating Kubernetes environments with Splunk Observability Cloud is a quick and easy way to ...