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!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...