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!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...