Getting Data In

Filtering on keywords with exceptions

nidhsha2
New Member

Hi,
I am trying to figure out if there is an easy way to filter based on a word and its negative-form.

For example, I want to filter for all data that does NOT include "dog" , BUT if there is a response with "no dog", then I want to capture that data as well.

index=data_log AND response!="*dog*"

Any ideas on this?

0 Karma
1 Solution

woodcock
Esteemed Legend

Like this:

index=data_log AND (response!="*dog*" OR response="*no dog*")

View solution in original post

0 Karma

woodcock
Esteemed Legend

Like this:

index=data_log AND (response!="*dog*" OR response="*no dog*")
0 Karma

nidhsha2
New Member

Did the trick, thank you!

0 Karma

skoelpin
SplunkTrust
SplunkTrust

Try this

index=data_log AND (response!="*dog*" OR response="no dog")

0 Karma

nidhsha2
New Member

Unfortunately I did try that, and my response of "no dog" is still not included. I think the != dog takes precedence over my next OR statement?

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...