Splunk Dev

Switching my code from Shell to Python and still use Splunk

alanxu
Communicator

Good Morning,
At the moment I have a log file that I am filtering through then outputting with a Shell Script. I put the filtered files in a folder on my desktop that automatically uploads to my local Splunk (changed the .config file). However, I feel like I am doing a shortcut using Shell so I plan on changing it to Python. My end goal is to be able to run my Python script and then have the data uploaded to Splunk and have Splunk monitor the data real time checking there is errors and create a dashboard to hold historic data. I was wondering does the Python SDK help with that? Or does it just help with searches?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Why not use the Spunk Universal Forwarder to send the files to Splunk? You can continue to use a shell or python script to do the filtering, but let the forwarder handle the I/O, retries, etc.

---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

Why not use the Spunk Universal Forwarder to send the files to Splunk? You can continue to use a shell or python script to do the filtering, but let the forwarder handle the I/O, retries, etc.

---
If this reply helps you, Karma would be appreciated.

alanxu
Communicator

Oh interesting I never heard of that

0 Karma

richgalloway
SplunkTrust
SplunkTrust

See http://docs.splunk.com/Documentation/Splunk/6.2.4/Forwarding/Introducingtheuniversalforwarder

---
If this reply helps you, Karma would be appreciated.
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

What Is Splunk? Here’s What You Can Do with Splunk

Hey Splunk Community, we know you know Splunk. You likely leverage its unparalleled ability to ingest, index, ...

Level Up Your .conf25: Splunk Arcade Comes to Boston

With .conf25 right around the corner in Boston, there’s a lot to look forward to — inspiring keynotes, ...

Manual Instrumentation with Splunk Observability Cloud: How to Instrument Frontend ...

Although it might seem daunting, as we’ve seen in this series, manual instrumentation can be straightforward ...