Splunk Search

How to search duration of time above a percentage?

mjones414
Contributor

I have data that has a watermark percentage, and a consumed percentage in a timechart. I want to determine how much time is spent above the watermark in a given window of time. How can I do this?

example:

.. | timechart span=4h avg(percent) as PercentUsed | eval "75th Percentile"=75 | ???transaction PerentUsed>"75th Percentile"???
0 Karma

lguinn2
Legend

It should be easy to identify the number of timespans that were above the threshold and then do the math to get the time over...

yoursearchhere
| timechart span=4h avg(percent) as PercentUsed 
| eval "75th Percentile"=75
| eval over_threshold = if(PercentUsed>75,1,0)
| stats sum(over_threshold) as spans_over
| eval time_out_compliance = tostring(spans_over * 4 * 60 * 60,"duration")
| fields - over_threshold spans_over
0 Karma
Get Updates on the Splunk Community!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...