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!

AppDynamics Summer Webinars

This summer, our mighty AppDynamics team is cooking up some delicious content on YouTube Live to satiate your ...

SOCin’ it to you at Splunk University

Splunk University is expanding its instructor-led learning portfolio with dedicated Security tracks at .conf25 ...

Credit Card Data Protection & PCI Compliance with Splunk Edge Processor

Organizations handling credit card transactions know that PCI DSS compliance is both critical and complex. The ...