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!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

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

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...