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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

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