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!

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