Reporting

Scheduled save search in every 30 minutes past 2 mins

rekakumaresan
Engager

How to run a saved search for every 2 minute in 30 minutes interval (i.e) it should run at 2.02, 2.32, 3.02, 3.32. I tried this 2/30 * * * *, but it is showing as invalid format

Labels (1)
Tags (2)
1 Solution

nickhills
Ultra Champion

If you are asking about a cron schedule, you can use this:
2,32 * * * *

Which means, run 2 AND 32 minutes past every hour, (every day of the month, every month, every day of the week)

To elaborate further, if you only wanted this to run during business hours, you could use
2,32 9-17 * * *
Which then says 2 & 32 minutes past every hour between 09 - 17

The / notation allows you to set repeats. If you wanted something to run every 17 (!?) minutes every 9 hours, it would be:
*/17 */9 * * *

If my comment helps, please give it a thumbs up!

View solution in original post

0 Karma

efavreau
Motivator

@rekakumaresan You were close. Comma, not slash. The following cron job will run on minutes 2 and 32 every hour, like in the example you gave.
2,32 * * * *

While it can't solve 100% of scenarios, for a majority of cron expression testing, try sites like crontab.guru:
https://crontab.guru/#2,32_*_*_*_*

###

If this reply helps you, an upvote would be appreciated.
0 Karma

nickhills
Ultra Champion

If you are asking about a cron schedule, you can use this:
2,32 * * * *

Which means, run 2 AND 32 minutes past every hour, (every day of the month, every month, every day of the week)

To elaborate further, if you only wanted this to run during business hours, you could use
2,32 9-17 * * *
Which then says 2 & 32 minutes past every hour between 09 - 17

The / notation allows you to set repeats. If you wanted something to run every 17 (!?) minutes every 9 hours, it would be:
*/17 */9 * * *

If my comment helps, please give it a thumbs up!
0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...