Splunk Search

Return only events where field value is in lookup table

bcarr12
Path Finder

Hi all,

I am running a search that returns many events. Some of these events contain a field value that is also in a lookup table I have uploaded. What is the best way to format my search in such a way that it ONLY returns events where the field value in the event is present in the lookup table? Right now, the lookup itself works, but the search returns all events, whether it can look up the field value or not.

Thanks!

jkat54
SplunkTrust
SplunkTrust
 index=myindex [ | inputlookup lookupname.csv | fields field1 field2 field3 | format] | ... rest of search

This will make a huge or statement with each of your fields:

 index=myindex ((field1=value) OR (field2=value2) OR field3=value3))

Add a NOT in front of the sub search if you want events that do not match fields&values in the lookup.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...