Alerting

How to setup cron to run in nighttime from 23:00 today to 6:00 tomorow at 8:00

phamxuantung
Communicator

I have an alert that I want to run between 23:00PM to 6:00AM, during that time, run the search "Last 24 hours", and email the result at 8:00 everyday. I have yet to found a way to trigger this.

Labels (2)
0 Karma
1 Solution

venkatasri
SplunkTrust
SplunkTrust

This one is right - The night one will run and print all the result in a csv (alert1) and (alert2) will run and email the result at 8:00 everyday.

Every hour cron during day time could be a new alert altogether.. cron you are already setting to every 60 mins 6-23. Last 24 hours is your timerange to search through that's not a cron.

View solution in original post

0 Karma

venkatasri
SplunkTrust
SplunkTrust

This one is right - The night one will run and print all the result in a csv (alert1) and (alert2) will run and email the result at 8:00 everyday.

Every hour cron during day time could be a new alert altogether.. cron you are already setting to every 60 mins 6-23. Last 24 hours is your timerange to search through that's not a cron.

0 Karma

venkatasri
SplunkTrust
SplunkTrust

Hi @phamxuantung 

IF you schedule an alert between 11 PM and 6 AM to run you can not differ the email to sent out at 08 AM.

Instead you could schedule the alert at above said time write the results to a summary index or lookup. At 08 AM you should schedule one more alert for Email Action alone looking into results either summary index or lookup file.

You will end up having 2 scheduled searches.

0 Karma

phamxuantung
Communicator

I want 2 alerts, one run at work hours and one run at night. The day one can i set the cron to "Last 24 hours"

 

*/60 6-23 *  * *

 

meaning every hour from 6:00 to 23:00 as 1 alert.

The night one will run and print all the result in a csv (alert1) and (alert2) will run and email the result at 8:00 everyday. Am I understand your ideal right?
But I still don't know how to set cron from 23:00PM to 6:00AM

0 Karma
Get Updates on the Splunk Community!

Index This | When is October more than just the tenth month?

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

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...