Splunk Search

Splunk query to compare a field from search with a field from lookup and find the unmatched ones

srivardhini92
Observer

Hi Can you please let me know how to frame splunk query compare a field from search with a field from lookup and find the unmatched ones from the lookup table

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

The general form is

<<some search that returns field 'foo'>> NOT [ | inputlookup mylookup.csv | field foo ]

If the lookup file does not contain 'foo' then you'll need a rename command to change what it has to 'foo'.

---
If this reply helps you, Karma would be appreciated.
0 Karma

PickleRick
SplunkTrust
SplunkTrust

@richgalloway's solution is one of the possible answers. It has its pros and cons. The other possibility is to search for all events, do a lookup on them and find non-matched ones.

<your_search>
| lookup your_lookup match_field OUTPUT match_field AS new_match_field
| where isnull(new_match_field

 Typically you'd use mine option later in the search pipeline while @richgalloway 's solution would probably be more suitable in the initial search.

Get Updates on the Splunk Community!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...