Alerting

How can I set up an alert to trigger every 30 minutes for a specified time range?

mahbs
Path Finder

Hi,
I want an alert to be triggered every 30 minutes from 7 p.m. to 11:30 p.m. only. I tried this but it doesn't seems to be working as expected.

Is this possible to do? I had a look at the cron expression and came up with something like this, but it's not working:

*/30 30,19,23 * * *

Please help!

0 Karma

harsmarvania57
Ultra Champion

Hi @mahbs,

Please use cron schedule as */30 19-23 * * *

EDIT: Based on @niketnilay suggestion there might be chances that all search will not run at 0th minute and 30th minute due to load on splunk server so in that case you can use 0,30 19-23 * * * credit goes to @niketnilay 🙂

I hope this helps.

Thanks,
Harshil

niketn
Legend

@harsmarvania57, there is a slight difference to the following but it ensures that it runs at 0th minute and 30th minute of hour between 19 to 23. Running every 30 minutes /30 implies if one execution delays (possible due to load on Splunk instance at that particular time, then subsequent runs will also be delayed).

0,30 19-23 * * 

I use Cron Tester provided at http://cron.schlitt.info/index.php for testing cron expressions: http://cron.schlitt.info/index.php?cron=0%2C30+19-23+*+*+*&iterations=20&test=Test

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

harsmarvania57
Ultra Champion

@niketnilay Well Spotted, thanks 🙂

0 Karma

mahbs
Path Finder

Thanks! But is it possible to get it from 19-23:30?

0 Karma

harsmarvania57
Ultra Champion

Yes, this will run between 19 to 24 (19:00,19:30,20:00,20:30,21:00,21:30,22:00,22:30,23:00,23:30)

0 Karma

mahbs
Path Finder

Ah I see. Brilliant. Thanks!

0 Karma

harsmarvania57
Ultra Champion

If my answer helps you then will you please accept my answer so that this question will be closed.

Thanks,
Harshil

0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...