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!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

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