Reporting

How to use cron schedule to automatically send a report on the last day of each month?

zoe
Path Finder

Hi, 

I would like to send a report  via Splunk automatically on the last day of each month.  In this case, I am afraid that I need to use cron schedule. Dose anyone have an idea?

Thanks in advance!

Tong

zoe_0-1663318567355.png

 

0 Karma

isoutamo
SplunkTrust
SplunkTrust

Unfortunately Cron haven't any (direct) way to run it only on last day of every month. The easiest way is just run it on 1st day of month if possible?

If you really need to run it on last day of every month, then you must create some additional logic on your job. It should check if tomorrow's day is 01 and then execute it otherwise stop. This may help you https://docs.splunk.com/Documentation/Splunk/9.0.1/SearchReference/Require?

Another way (not perfect as there are leap years) is just divide that to several entires based on amount of days per month.

Here is some additional discussion about this issue: https://stackoverflow.com/questions/6139189/cron-job-to-run-on-the-last-day-of-the-month

0 Karma
Get Updates on the Splunk Community!

Index This | What did the zero say to the eight?

June 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

Splunk Observability Cloud's AI Assistant in Action Series: Onboarding New Hires & ...

This is the fifth post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Now Playing: Splunk Education Summer Learning Premieres

It’s premiere season, and Splunk Education is rolling out new releases you won’t want to miss. Whether you’re ...