Alerting

Alert trigger conditions

danbutterman
Explorer

Hello Splunk community,

I have an alert setup that will trigger when a website status does not equal 200:

index=perfmon host="nameofsearchhead" sourcetype=httpstatus 
| where status!=200 
| lookup Prod-Websites.csv url AS url OUTPUTNEW server
| table _time,url,status

The results in the statistics tab show up as three columns: time, url, status code.

The alert currently triggers whenever I receive more than 4 results (which could be 5 different urls, that had a single non-200 event each).

I would like for the alert to trigger whenever I receive more than 4 results (non-200 events) for a single url, instead.

Tags (1)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

Try like this

Alert search

index=perfmon host="nameofsearchhead" sourcetype=httpstatus 
 | where status!=200 
 | lookup Prod-Websites.csv url AS url OUTPUTNEW server
 | table _time,url,status | eventstats count by url | where count>4

Alert condition

when number of results > 0

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

Try like this

Alert search

index=perfmon host="nameofsearchhead" sourcetype=httpstatus 
 | where status!=200 
 | lookup Prod-Websites.csv url AS url OUTPUTNEW server
 | table _time,url,status | eventstats count by url | where count>4

Alert condition

when number of results > 0

danbutterman
Explorer

Will do!

Thank you, somesoni2!

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...