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!

.conf24 | Day 0

Hello Splunk Community! My name is Chris, and I'm based in Canberra, Australia's capital, and I travelled for ...

Enhance Security Visibility with Splunk Enterprise Security 7.1 through Threat ...

(view in My Videos)Struggling with alert fatigue, lack of context, and prioritization around security ...

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...