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
SplunkTrust
SplunkTrust

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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

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

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...