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!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...