Getting Data In

How to exclude a list of values for a field?

jundai
Explorer

Is there a shorthand for:

host=SOMEENV* Type=Error NOT EventCode=1234 NOT EventCode=2345 NOT EventCode=3456 NOT EventCode=4567 NOT EventCode=5678 NOT EventCode=6789 NOT EventCode=7890

Basically, I'm looking for something like:

host=SOMEENV* Type=Error NOT EventCode IN (1234, 2345, 3456, 4567, 5678, 6789, 7890)

but of course that doesn't work 🙂

Tags (3)
1 Solution

Damien_Dallimor
Ultra Champion
host=SOMEENV* Type=Error NOT (EventCode=1234 OR EventCode=2345 OR EventCode=3456 OR EventCode=4567 OR EventCode=5678 OR EventCode=6789 OR EventCode=7890 )

View solution in original post

AndyMarr
Explorer

Better to use the...NOT EventCode IN...listed in one of the other answers below

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...

Global Splunk User Group Events: May + June 2026

Your Splunk Community Awaits: Discover Upcoming User Group Events Worldwide    Staying ahead in the fast-paced ...