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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...