Splunk Search

compare data that not include in lookup file

rahmatn
Path Finder

Dear All, 
Need your help


I have case  to compare transaction data with lookup file, for example i have lookup file account.csv

it contain :

NameAccountNo
Jack1234
Bobby4321
Bobby3214
Donny7890

 

and then i have daily transaction like :

NameAccountNoAmount
Bobby43211000
Jack1234500
Donny7890500
Bobby88885000



i want to marking this daily transaction base on Name that has no AccountNo in lookup table account.csv
the marking can be a note or something else

thanks in advance for your help

Rahmat

0 Karma
1 Solution

gcusello
SplunkTrust
SplunkTrust

Hi @rahmatn,

I suppose that you're using DB-Connect to query data.

usually DB-Connect is used to extract data (using an SQL Query) and put them in an index.

When you have data in an index, you can run a search like the one I hinted.

Anyway, if the problem is how to use the search, you could run something like this:

your_query
| search NOT [ | inputlookup account.csv | fields Name ]
| table Name AccopuntNo Amount

put attention that the field name "Name" is the same in query output and lookup, otherwise you have to modify your search:

your_query
| rename query_name AS Name 
| search NOT [ | inputlookup account.csv | fields Name ]
| table query_name AccopuntNo Amount

Ciao

Giuseppe

View solution in original post

rahmatn
Path Finder

i mean may be i was wrong on how to use the lookup command 

0 Karma

rahmatn
Path Finder

Hi Guiseppe, 

Thanks for your response, but it not solve my case

Actually the transaction data coming from SQL and the lookup is in the splunk
so i have to run the SQL query first and then using lookup command as subsearch

i cannot use "NOT" before the subsearch, or may be i 

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @rahmatn,

I suppose that you're using DB-Connect to query data.

usually DB-Connect is used to extract data (using an SQL Query) and put them in an index.

When you have data in an index, you can run a search like the one I hinted.

Anyway, if the problem is how to use the search, you could run something like this:

your_query
| search NOT [ | inputlookup account.csv | fields Name ]
| table Name AccopuntNo Amount

put attention that the field name "Name" is the same in query output and lookup, otherwise you have to modify your search:

your_query
| rename query_name AS Name 
| search NOT [ | inputlookup account.csv | fields Name ]
| table query_name AccopuntNo Amount

Ciao

Giuseppe

gcusello
SplunkTrust
SplunkTrust

Hi @rahmatn,

you could run something like this:

index=your_index NOT [ | inputlookup account.csv | fields Name ]
| table Name AccopuntNo Amount

Ciao.

Giuseppe 

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...