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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...