Getting Data In

Windows Script Input (something simple i'm sure)

hewhib
Explorer

Guys,

Just wondering if you could help me...

When I go to add a scripted input for my Splunk App I get the following error message:

Encountered the following error while trying to save: In handler 'script': The command path `"c:\program files\splunk\etc\apps\winFW\bin\rules.py"` is not allowed for scripted inputs.

Using the following command path:

"c:\program files\splunk\etc\apps\winFW\bin\rules.py"

I have tried it with and without the " , and tried the path as a above and as it appears on the command line (i.e. "C:\Program Files\Splunk\etc\apps\winFW\bin\rules.py") Can someone explain where I am going wrong please.

Cheers

jbsplunk
Splunk Employee
Splunk Employee

I have one working that looks very similar to this in my inputs.conf:

[script://$SPLUNK_HOME\etc\apps\app_name\bin\script.bat]
disabled = false
index = someindex
interval = #####
sourcetype = somesourcetype

Hope this helps!

hewhib
Explorer

Not sure what I did, but after playing around with my python script, I tried it again and it worked. But thank-you for you help, I will note the last comment, I'm sure I will need it

0 Karma

jbsplunk
Splunk Employee
Splunk Employee

Its just a batch file. If your using a python script it should be fine too, just be sure your paths are configured so that Windows understands.

Something like "stuff = open(os.path.join(os.environ["SPLUNK_HOME"], 'etc', 'apps', 'app_name', 'bin', 'scripts', 'yourscript.py'),'r')" would do the trick.

hewhib
Explorer

in your inputs.conf file, I'm assuming you have a batch file not a python script? or do you have a batch file calling the python script.

0 Karma
Get Updates on the Splunk Community!

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...

Splunk Up Your Game: Why It's Time to Embrace Python 3.9+ and OpenSSL 3.0

Did you know that for Splunk Enterprise 9.4, Python 3.9 is the default interpreter? This shift is not just a ...