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
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 ...