Splunk Search

Stats based on Case

Jamie2Jamie
Loves-to-Learn Lots

I'm still new, and struggling with the following. I am looking at a set of data from three probes. If all three probes show success of "down" for the reporting period than I would like the result to be "down", but if one or more have a success of "up" than it should be considered "up" for that time span.

For instance:

12:00 - Probe1 - Up

12:00 - Probe2 - Down

12:00 - Probe3 - Up

13:00 - Probe1 - Down

13:00 - Probe2 - Down

13:00 - Probe2 - Down

So, for 12:00 the value would be Up, and for 13:00 the value would be down...

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

There's likely more than one way to do that.  Here's the first one I thought of.

Bucket the results by the hour and count the ones that are "down".  If that count is zero then make the result "down"; otherwise, make the result "up".

... | bin span=1h _time
| stats count(eval(success="down")) as downCount by _time
| eval result = if(downCount==3,"down","up")
| table _time result

If you want to know which probes are down then this variation should do it.

... | bin span=1h _time
| where success="down"
| stats values(success) as downProbes by _time
| eval result = if(mvcount(downProbes)==3,"down","up")
| table _time result downProbes 
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...