Splunk Search

How to compare event data with lookup data to find missing field values?

gauravu_14
Explorer

I need to compare the values of 2 fields from the Splunk data with the field-values from the lookup and find the missing values from the Splunk data and output those missing field value pairs

For ex:

index=test  sourcetype=splunk_test_data
fields: field1, field2

lookup: test_data.csv
Fields: field1, field2

The output should show missing values from the Splunk data and output those missing values

Any help would be appreciated 
Thanks

Labels (1)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

To find out which fields are present in the lookup and absent in the index use a subsearch, like this:

| inputlookup test_data.csv where NOT [search index=test sourcetype=splunk_test_data | fields field1 field2 | format]
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

To find out which fields are present in the lookup and absent in the index use a subsearch, like this:

| inputlookup test_data.csv where NOT [search index=test sourcetype=splunk_test_data | fields field1 field2 | format]
---
If this reply helps you, Karma would be appreciated.

gauravu_14
Explorer

I would like to know which values are missing in the events compared to the lookup and output those field-values

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The same search should do that.  It's a matter of how extensive the lookup file is.

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...