Alerting

Issue with URL monitoring over the website monitoring app

jackin
Path Finder

Hello,
We have a few URLs being monitored by a splunk alert(query pasted below for reference) by making use of the "Website Monitoring" add on.
It has however been observed, that a few URLS randomly generate a non 200 HTTP status codes that automatically get resolved in the next iteration.
We've therefore been asked to implement a logic wherein an alert should only be raised if a URL fails two times consecutively.

Query:

index=urlperf sourcetype="web_ping"
[| inputlookup URL_Title.csv]
| stats latest(response_code) as response_code latest(_time) as _time by url
| where response_code>=300
| eval Status="Down",Timestamp=strftime(_time,"%d/%m/%Y %H:%M:%S")
| rename response_code as "HTTP Response Code" url as URL
| table Timestamp,URL,"HTTP Response Code", Status
| dedup URL

An an example : Considering URL being monitored is "http://mywebsite.com" with frequency as 5 mins ,
the stake holders want an alert to be raised only for "case 2" and NOT for "case1" .
Could some one please help, on how could we accomplish this through a splunk alert.

case 1 :08:00 hrs url=http://mywebsite.com response_code=404 timed_out=False

              08:05 hrs url=http://mywebsite.com response_code=200 timed_out=False

case 2 :08:00 hrs url=http://mywebsite.com response_code=504 timed_out=False

               08:05 hrs url=http://mywebsite.com response_code=401 timed_out=False

Thank you in advance !

Labels (3)
0 Karma
Get Updates on the Splunk Community!

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 ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...