Splunk Search

is there a logical OR available for searching?

di2esysadmin
Path Finder

This has to be splunk 101.

There has be something better than

NOT sourcetype=top NOT sourcetype=ps NOT sourcetype=openPorts

Something along the lines of

NOT sourcetype in (top, ps, openPorts)

???

Thanks for the help!

Oh .. and one more question, there's a shortcut to insert "NOT sourcetype=blah" by holding down a key combination and mouse clicking on the "blah" in the current search results. What is the key combination on both windows and mac? Thanks.

Tags (3)

MuS
Legend

Hi di2esysadmin,

well, your example is not an OR search, it is an AND search. The AND directive is implied between terms, so you do not need to write it - this means

`foo AND bar`

is the same like this

`foo bar`

Back to your question: to search for multiple OR statements you can do something like this:

`NOT ( sourcetype="top" OR sourcetype="ps" OR sourcetype="openPorts" )`

Please see the docs on writing better searches, where you can see that one should avoid NOT searches but instead search for event you want. NOT searches will have negative performance impact on long time searches.

Regarding the keyboards shortcuts, find information in the docs about Keyboard_navigation_using_Firefox_and_Mac_OS_X

hope this helps ...

cheers, MuS

martin_mueller
SplunkTrust
SplunkTrust

Concerning the NOT sourcetype=blah key combination, that used to be Alt+Click in the Splunk<=5 flashtimeline view, but for me that stopped working in the Splunk 6 search view. It's probably going to be fixed in the next major version as per http://answers.splunk.com/answers/109473/alt-click-not-working-selected-fields

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...