Getting Data In

Any solid example of a scripted input on Windows?

maverick
Splunk Employee
Splunk Employee

..as in, I have a .cmd or a .bat file that I would like to use as a scripted input.

I am not able to find any solid examples of how the script:// stanza within my inputs.conf file looks like that actually works.

Anyone do this already that is willing to share their stanza?

0 Karma

ndoshi
Splunk Employee
Splunk Employee

The Splunk IP Watchlist app has a simple bat file to retrieve IP addresses and uses scripted input to call this bat file to gather the data. It's a simple approach as I'm not much of a DOS style script writer.

http://splunkbase.splunk.com/apps/All/4.x/app:Global+Threat+Landscape%7FIP+Watch+list+V2

0 Karma

ziegfried
Influencer

[script://$SPLUNK_HOME\etc\apps\myapp\bin\myscript.bat]
disabled = false
index = myindex
interval = 3600
sourcetype = mysourcetype

0 Karma

jflomenberg
Splunk Employee
Splunk Employee

Also note that if you are calling a python script you'll similarly want to make sure that path within it are set in a way that Windows can handle along the lines of
theFile = open(os.path.join(os.environ["SPLUNK_HOME"], 'etc', 'apps', 'bmon-eventgen', 'bin', 'sample', 'noise_apache.sample'),'r')

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...