Getting Data In

scripted input execute condition

aaronkorn
Splunk Employee
Splunk Employee

Hello,

We are working towards a scripted input of AIX errpt messages and would like to kick the script off whenever it notices the timestamp changes, ie. when a new event is added. The file is binary so we need to have a custom script to run first to decode the data then dump it to a file. Any idea on how to do a conditional script interval in inputs.conf? Also, if you have seen a better way to aggregate errpt messages please feel free to share. Thanks!

0 Karma

sowings
Splunk Employee
Splunk Employee

I don't have an answer, per se, but I have some input:

There's a magic value to interval in an inputs.conf script: specifier (I think it's zero) that means "run once on startup". But then you'd have to restart the forwarder a lot.

If I were asked to implement this, I would put the logic in my script. I'd use a persistent state file (maybe in $SPLUNK_HOME/var/lib/splunk/persistentstorage) to keep track of the last stamp we'd seen, then use this script to inspect the file on each run. Most executions of the script are going to be no-ops "data hasn't changed!", but when it does execute the decoding loop, you'll want to make sure that the interval of the script is longer than the amount of time a single run would take. Splunk shouldn't start a second instance until the first is done, but I would schedule my runs so that I didn't have to rely upon that.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...