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!

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

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...