Splunk Enterprise

How to create a search to see all alerts?

vishwa
Path Finder

We have many alerts setup in Splunk, so how can I get the list of alerts corn scheduled for 10mins 

 

Labels (1)
Tags (2)
0 Karma

bowesmana
SplunkTrust
SplunkTrust

You can use the rest api to get the saved searches and look at the cron schedule

| rest splunk_server=local /servicesNS/-/-/saved/searches 
| where disabled=0 AND is_scheduled=1 
| fields title cron_schedule next_scheduled_time

then you can do what you need to do with that data

0 Karma

vishwa
Path Finder

@bowesmana , thank you for the query

But I am getting all the alerts how can I add filter to see only 10 mins scheduled alerts

I tried using search or where command for cron scheduled field but it not coming.

0 Karma

bowesmana
SplunkTrust
SplunkTrust

You need to look at the minute part of the cron schedule, for example you could do this at the end of the other search I gave to you

| eval ten_minute_schedule=if(match(cron_schedule, "^\*/10"), 1, 0)
| where ten_minute_schedule=1

 

0 Karma

bowesmana
SplunkTrust
SplunkTrust

Can you explain what you mean by to see only 10 mins scheduled alerts

Does that mean alerts that are scheduled to run in the next 10 minutes or alerts that are scheduled to run every 10 minutes or...?

0 Karma

vishwa
Path Finder

I want to see the list of  alerts  that are scheduled to run every 10 minutes

0 Karma

inventsekar
SplunkTrust
SplunkTrust
0 Karma
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...