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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...