Knowledge Management

I'd like a query executed that shows the duration of the outage

Sandeep007
New Member

Can anyone help me to write a Splunk query for when I have an outage I'd like a query executed that shows the duration of the outage.  If I check 5XX or 4XX errors, It will show some logs in  hour 5 or 10 mins period ex: I checked 500 errors 10pm to 11pm...  in that one hour, errors started from 10:15pm to 10:45pm , I want only period {10:15pm to 10:45pm } no need logs  .. for that How I need to write quarry 

Labels (1)
0 Karma

tscroggins
Influencer

@Sandeep007 

If you're looking for time ranges within 1-hour periods, you can use e.g. timechart:

sourcetype=access_common status=500
| timechart span=1h earliest(_time) as et latest(_time) as lt range(_time) as duration
| fieldformat et=strftime(et, "%F %T")
| fieldformat lt=strftime(lt, "%F %T")
| fieldformat duration=tostring(duration, "duration")

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