Splunk Search

Find the "No events"

fred1455
New Member

Given the search

stats count by Name, Fruit

results in:

Name, Fruit, count
Mike, Bananas, 10
Mike, Apples, 10
Susan, Apples, 5
Fred, Apples, 8
Susan, Oranges, 9
Fred, Oranges, 9

How to find only the persons without Oranges?
Result should be:

Mike
****

As the names are dynamic I do not have an inputlookup file for them ...
Thanks
Robert

Tags (1)
0 Karma

woodcock
Esteemed Legend

Like this:

index=YouShouldAlwaysSpeciryAnIndex AND sourcetype=AndSroucetypeToo
| stats count BY Name, Fruit

| rename COMMENT AS "I believe that above is your existing search, so just add what is below"

| evenstats values(Fruit) AS Fruits BY Name
| search NOT Fruits = "Oranges"
0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Assuming you're looking for names that have fruit but no Oranges, stats values(Fruit) as Fruits by Name | search NOT Fruits = "Oranges".

If you're also looking for names that have no fruit at all then you'll need a list of reference names, otherwise any name ever would need to magically appear out of nowhere.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Then you didn't run the search I wrote.

0 Karma

fred1455
New Member

Thanks for you effort.

But this will return:

Also Susan and Fred (as the also have lines without Oranges!)

What I want to see in my result is:

Only Mike

(as he is the only person without oranges)

But thanks

Robert

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...