Splunk Search

Filtering on combination of 2 values

jpfrancetic
Path Finder

Hi Splunk Community,

I am currently working with a search but I am trying to filter certain events out. I am trying to remove events with user=unknown and id=123456. When I do | where (id=123456 AND user!="unknown"), it removes both events with an unknown user and events with the id = 123456. I would like to keeps all other events with an unknown user and all other events from 123456 while only dropping events where user is unknown AND id=123456.

Thanks in advance!

Labels (1)
0 Karma
1 Solution

Stefanie
Builder

Try this?

|search NOT ((id=123456 AND user="unknown"))

View solution in original post

Chiranjeev
Explorer

you can try |where !(id=123456 AND user="unknown").

hope it helps ,give a thumbs up if you like the answer

0 Karma

Stefanie
Builder

Try this?

|search NOT ((id=123456 AND user="unknown"))

jpfrancetic
Path Finder

Worked like a charm, thank you!

Get Updates on the Splunk Community!

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Your Voice Matters! Help Us Shape the New Splunk Lantern Experience

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Building Momentum: Splunk Developer Program at .conf25

At Splunk, developers are at the heart of innovation. That’s why this year at .conf25, we officially launched ...