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!

Index This | What are the 12 Days of Splunk-mas?

December 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

Get Inspired! We’ve Got Validation that Your Hard Work is Paying Off

We love our Splunk Community and want you to feel inspired by all your hard work! Eric Fusilero, our VP of ...

What's New in Splunk Enterprise 9.4: Features to Power Your Digital Resilience

Hey Splunky People! We are excited to share the latest updates in Splunk Enterprise 9.4. In this release we ...