Alerting

i want a splunk query for alert , if a event takes more than 30 minutes of time , the alert will trigger, please anyone can guide ?

shubham1234
New Member

In splunk , as one production server many event are occurring everyday so i need a query for splunk to know if any event is taking more than 30 minutes of time, i need a alert for those type of event.

Thank You

Tags (3)
0 Karma

woodcock
Esteemed Legend

You can do something like this:

| tstats avg(_indextime) AS avg_indextime max(_indextime) AS max_indextime WHERE index=* BY sourcetype host _time
| stats avg(avg_indextime) AS avg_indextime max(max_indextime) AS max_indextime BY sourcetype host
| where ((avg_indextime > 30*60) OR (max_indextime > 30*60))
0 Karma

kmorris_splunk
Splunk Employee
Splunk Employee

So, when you say an event is taking more than 30 minutes, does that mean you have multiple events with the same Subscriber Number or some other unique ID. And I'm assuming there is an event that indicates completion of something (start and stop for example)?

0 Karma

Vijeta
Influencer

@shubham1234 What is the timestamp for events? You can take the difference of index time and subtract it from _time to know if the difference is 30 min or more.

0 Karma

shubham1234
New Member

@Vijeta - i can take the index time , but many request are coming , for example one event is started at 9.00 a.m with one subscriber number and another same event start at 9.30 a.m , but the difference is , this time onother event start with different subscriberNumber( it is a number which is provided to person as a kind of validity) . so if i will use timeStamp , will it work ?

Thank you

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...