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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...