Splunk Search

How can I filter my search if I don't want to return results containing certain field-value pairs?

sympatiko
Communicator

Hi splunkers,

Good day! How can I write a search if I don't want all HOST and PROCESS fields.

Say for example, I don't want:
host=10.10.10.10, process=apache2, mysql, etc..

Thanks

Tags (2)
0 Karma
1 Solution

sduff_splunk
Splunk Employee
Splunk Employee
NOT host=10.10.10.10 NOT process=apache2 NOT process=mysql

View solution in original post

0 Karma

sduff_splunk
Splunk Employee
Splunk Employee
NOT host=10.10.10.10 NOT process=apache2 NOT process=mysql
0 Karma

woodcock
Esteemed Legend

Please also be aware that NOT process=apache2 is NOT the same as process!=apache2. The former keeps events where isnull(process) is TRUE, whereas the latter does not (drops events where isnull(process) is TRUE. This may matter to you.

sympatiko
Communicator

You're a God!

0 Karma

MuS
Legend

Just to add something; NOT search should be avoided, especially in regards of search performance and scalability. See the docs about this http://docs.splunk.com/Documentation/Splunk/6.2.4/Search/Writebettersearches#Tips_for_tuning_your_se...

sympatiko
Communicator

Thanks for the tips. But no worries I just used it in order to extract a specific details from a data that I uploaded

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...