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!

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