Getting Data In

Is it possible to configure scripted input to run at a certain time in the day?

remy06
Contributor

Hi,

Currently via the web UI I believe we can only set the interval time for scripted inputs to run.

Is it possible to schedule the script to run at a certain time of a day?say 23:59? instead of intervals?

1 Solution

gkanapathy
Splunk Employee
Splunk Employee

Yes it is. If you specify interval as a cron-type schedule, it will run on that schedule. From inputs.conf.spec:

interval = <integer>|<cron schedule>
* How often to execute the specified command (in seconds), or a valid cron schedule. 
* NOTE: when a cron schedule is specified the script is not executed on start up
* Defaults to 60 seconds.

So you can set:

interval = 59 23 * * *

View solution in original post

gkanapathy
Splunk Employee
Splunk Employee

Yes it is. If you specify interval as a cron-type schedule, it will run on that schedule. From inputs.conf.spec:

interval = <integer>|<cron schedule>
* How often to execute the specified command (in seconds), or a valid cron schedule. 
* NOTE: when a cron schedule is specified the script is not executed on start up
* Defaults to 60 seconds.

So you can set:

interval = 59 23 * * *

Lowell
Super Champion

If I am not mistaken, this is a new feature in 4.1.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...