Splunk Search

Filtering results by count on one item

pitshot
Explorer

What I am trying to accomplish.
Search for three items X Y and Z .
Count the total number of events for each X Y Z .
Display any results from X or Y and only display Z when the count is above 1.

I am having trouble with the last part of this search. I am not sure how to process the count of the Z result and drop results below the count of 1. I have tried several techniques but I have not had any success in putting the searches together.

Tags (1)
1 Solution

strive
Influencer

Try this

index=MyIndex (EventType="X" OR EventType="Y") | stats count as Count by EventType | append [search index=MyIndex EventType="Z" | stats count as Count by EventType | where Count > 1]

View solution in original post

strive
Influencer

Try this

index=MyIndex (EventType="X" OR EventType="Y") | stats count as Count by EventType | append [search index=MyIndex EventType="Z" | stats count as Count by EventType | where Count > 1]

pitshot
Explorer

Perfect, I was making the search into something way to complicated. The append works great Thanks

0 Karma
Get Updates on the Splunk Community!

Splunk Decoded: Service Maps vs Service Analyzer Tree View vs Flow Maps

It’s Monday morning, and your phone is buzzing with alert escalations – your customer-facing portal is running ...

What’s New in Splunk Observability – September 2025

What's NewWe are excited to announce the latest enhancements to Splunk Observability, designed to help ITOps ...

Fun with Regular Expression - multiples of nine

Fun with Regular Expression - multiples of nineThis challenge was first posted on Slack #regex channel ...