Alerting

How can I use cron to schedule for quarterly reports at certain intervals?

dmenon84
Path Finder

Hi,

I want to schedule the report at following intervals

9/1 - 11/30
12/1 - 2/28(29) (this is an odd one because of leap years)
3/1 - 5/31
6/1 - 8/31

How can I do this using the cron schedule? Thanks in advance!

Thanks,
Deepthi

0 Karma

somesoni2
Revered Legend

Assuming you want your quarterly report to run as following:

Quarter range     ###   Date on which Report should be run
9/1 - 11/30       ###  12/01 
12/1 - 2/28(29)   ###  03/01
(this is an odd one because of leap years)
3/1 - 5/31        ###   06/01
6/1 - 8/31        ###   09/01

Try the cron schedule as this (running every quarter, as above schedule, at 3 AM in the morning

0 3 1 3,6,9,12 *

Your search's time range would be -3mon@mon to @mon.
See the corresponding scheduled data here: https://crontab.guru/#0_3_1_3,6,9,12_* (click on next hyperlink to see more dates)

0 Karma

FrankVl
Ultra Champion

Is it OK to run the report at midnight of the first day of the next quarter? That would translate to 0 0 1 */3 *.

Then you just need to define the timerange for your report correctly, I guess earliest=-3mon@mon latest=@mon should do the trick?

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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