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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...