Getting Data In

How to use python scripts as a scripted input for parsing?

hkmurali
New Member

I have a set of log files that has to be parsed using python. I Have this file "scriptedfile.py"
As a newbie, I tried going through documentation, especially this link :
http://docs.splunk.com/Documentation/Splunk/6.5.1/Data/Getdatafromscriptedinputs#Where_to_place_the_...

But I am not able to follow much of the steps here , especially modifying some "inputs.conf" file. So I'd hope if someone can translate this in some simpler words and tell me the steps to about parsing my log files with the script and then use it for further analysis in Splunk.

In case this helps, I found this In the below path
C:\Program Files\Splunk\etc\system\local, i found an inputs.conf with just two lines :

[default]
host = ATA1CJSKCR

Thanks 🙂
Karthik

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Scripted inputs are usually associated with an app rather than the system. It's a good to create a company app for this purpose.

Once you've decided on a location for your script, it's a simple matter to edit the relevant inputs.conf file and insert the following lines. They will cause your script to run every 5 minutes with the output sent to index "foo". You'll want to change the index and sourcetype names and the interval to suit your environment. Restart Splunk after editing the file.

[script:///opt/splunk/etc/app/ourapp/bin/scriptedfile.py]
disabled = 0
index = foo
interval = 300
sourcetype = bar
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Scripted inputs are usually associated with an app rather than the system. It's a good to create a company app for this purpose.

Once you've decided on a location for your script, it's a simple matter to edit the relevant inputs.conf file and insert the following lines. They will cause your script to run every 5 minutes with the output sent to index "foo". You'll want to change the index and sourcetype names and the interval to suit your environment. Restart Splunk after editing the file.

[script:///opt/splunk/etc/app/ourapp/bin/scriptedfile.py]
disabled = 0
index = foo
interval = 300
sourcetype = bar
---
If this reply helps you, Karma would be appreciated.
0 Karma

hkmurali
New Member

Thanks Richgalloway, let me try this

0 Karma

gesman_splunk
Splunk Employee
Splunk Employee

Note: 'interval' value is in seconds, not in minutes.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...