Splunk Search

Multiple searches on the same field?

whucks
Engager

Is it possible to perform multiple searches on the same field? For reporting purposes I want to search for all values less than zero, equal to zero, and greater than zero.

Tags (2)
1 Solution

dwaddle
SplunkTrust
SplunkTrust

Sure.. just use OR

my awesome search terms AND ( foo=0 OR foo>200 OR foo <5 )

Now, if you're wanting to do some distribution analysis, it might be more like

my awesome search terms | eval disposition=case(foo < 0, "Lessthanzero", 
foo=0 , "EqualZero", 
foo > 0, "GreaterThanZero") 
| stats count(_raw) by disposition

View solution in original post

dwaddle
SplunkTrust
SplunkTrust

Sure.. just use OR

my awesome search terms AND ( foo=0 OR foo>200 OR foo <5 )

Now, if you're wanting to do some distribution analysis, it might be more like

my awesome search terms | eval disposition=case(foo < 0, "Lessthanzero", 
foo=0 , "EqualZero", 
foo > 0, "GreaterThanZero") 
| stats count(_raw) by disposition

rps462
Path Finder

If this isn't working for you .. it's ok, you're not crazy. Chances are you have "or" instead of "OR". Make sure it's capitalized.

0 Karma

whucks
Engager

Thank you very much for your answer to my question. Your solution worked perfectly.

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...