Splunk Search

How to use a list of values from a table into foreach fieldstr?

danielearangiom
Explorer

Hi,
I already used the following lines with success:

| foreach fieldstr=device "device_name1" "device_name2" "device_name3" "device_nameN" 
    [ eval device= "<<FIELD>>"]

But, is it possible to pass a list of my devices name from a lookup table? I mean, something like:

| foreach fieldstr=device inputlookup devices_list.csv
    [ eval device= "<<FIELD>>"]

With devices_list.csv as:

device
...
device_name1
device_name2
device_name3
device_nameN

Tags (2)
0 Karma

VatsalJagani
SplunkTrust
SplunkTrust

Hi @danielearangiomazza,
I don't understand your question properly, if you can give query before foreach or sample input-output so I can help you.

0 Karma
Get Updates on the Splunk Community!

The Payment Operations Wake-Up Call: Why Financial Institutions Can't Afford ...

The same scenario plays out across financial institutions daily. A payment system fails at 11:30 AM on a busy ...

Make Your Case: A Ready-to-Send Letter for Getting Approval to Attend .conf25

Hello Splunkers, Want to attend .conf25 in Boston this year but not sure how to convince your manager? We've ...

Community Spotlight: A Splunk Expert's Journey

In the world of data analytics, some journeys leave a lasting impact not only on the individual but on the ...