Reporting

Cronjob for 48 hours

N92
Path Finder

How to set report for every 48 hours. What should be cronjob for that.

If I am set "* * */2 * *". It can run at every two days(48 hours). But there should be issue at month end because it can be 30 0r 31 days/month.

Tags (1)
0 Karma
1 Solution

FrankVl
Ultra Champion

Don't think there is any way to do that in a pure cron schedule solution. You can either define it by day of month or day of week, both will cause issues since months regularly have an odd number of days and weeks by definition have an odd number of days.

I would seriously consider rethinking whether it really needs to be a 48h report. Can't it be daily?

Or can it be on specific week days, e.g. every monday, wednesday, friday (which is something you can define in cron)? Although I guess the trouble with that is that if you define the search to include past 48h, there will be a gap somewhere around friday/saturday depending on the exact timings.

View solution in original post

0 Karma

FrankVl
Ultra Champion

Don't think there is any way to do that in a pure cron schedule solution. You can either define it by day of month or day of week, both will cause issues since months regularly have an odd number of days and weeks by definition have an odd number of days.

I would seriously consider rethinking whether it really needs to be a 48h report. Can't it be daily?

Or can it be on specific week days, e.g. every monday, wednesday, friday (which is something you can define in cron)? Although I guess the trouble with that is that if you define the search to include past 48h, there will be a gap somewhere around friday/saturday depending on the exact timings.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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