Alerting

How to write a query for getting data that is not present in lookup table

aaa2324
Explorer

How to write a query for getting data that is not present in lookup table, compare the input data with lookup table and find only the data is not present in lookup table.

already tried below query not working

index=abc sourcetype=xyz
| lookup data.csv ccid OUTPUT ccid AS found
| where isnull(found)

 

Labels (1)
0 Karma

aaa2324
Explorer

Thanks will try that keep you posted with the results

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @aaa2324,

you have to use a subsearch of the main search containing an inputlookup command, only one attention: fieldnames must be the same both in main search and lookup or remene one of them.

Please try something like this:

index=abc sourcetype=xyz NOT [ | inputlookup data.csv | rename ccid AS found | fields found ]
| ...

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk on November 6 at 11AM PT, and empower your SOC to reach new heights! Duration: ...

Splunk Observability as Code: From Zero to Dashboard

For the details on what Self-Service Observability and Observability as Code is, we have some awesome content ...