Splunk Search

reference lookup name in table

jat75
Explorer

I have a search where I am doing 2 inputlookups for 2 different lookups and appending them. Then I search them. Can I table the lookup name as a field for where the result was found? Thanks.

Labels (1)
0 Karma

jat75
Explorer

From a nice bloke on reddit:

Example if you are using lookups normally:

| lookup my_lookup1.csv field1 OUTPUT outfield1
| lookup my_lookup2.csv field1 OUTPUT outfield2
| eval outfield = coalesce(outfield1,outfield2,"not found")
| eval tablesource = case(isnotnull(outfield1),"my_lookup1.csv",
 isnotnull(outfield2),"my_lookup2.csv",
 true(),"not found")

Example if you are using inputlookup:

 | inputlookup my_lookup1.csv 
 | eval tablesource="my_lookup1.csv"
 | inputlookup my_lookup2.csv append=true
 | eval tablesource=coalesce(tablesource,"my_lookup2.csv")
0 Karma
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Observability Simplified: Combining User Experience, Application Performance & ...

Tech Talk Observability Simplified: Combining User Experience, Application Performance & Network ...

Event Series May & June: From Network Visibility to Service Intelligence

Unifying the Network: Moving from Alert Noise to Service Intelligence with Splunk ITSI In today’s hybrid ...