Splunk Search

Is there is a way to output the contents of a Lookup file but also show the Lookup file name as results?

finchy
Explorer

Hi Splunkers,

I was wondering if there is a way to output the contents of a Lookup file but also show the Lookup file name as results so for example

| inputlookup append=t <filename1>.csv
| inputlookup append=t <filename2>.csv
| inputlookup append=t <filename3>.csv

 

Running the above will show the contents but would like to know which file the contents relates to.

Thanks

Labels (1)
0 Karma

batabay
Path Finder

You can try this ; 

| inputlookup append=true test1.csv 
| eval order = "test1.csv" 
| inputlookup append=true test2.csv 
| eval order = if(isnull(order),"test2.csv",order) 
| inputlookup append=true test3.csv 
| eval order = if(isnull(order),"test3.csv",order)
0 Karma

finchy
Explorer

Thanks.  This helps me out

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @finchy,

let me understand: you want the list of available lookups, is this correct?

if this is your need, you could use a REST API command:

| rest /services/data/lookup-table-files

filtering results using one or more of the available fields.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...