Splunk Search

Use field values in a query for loop

nwong1
New Member

Hi, I want to use field values for a search query and then export the results for each field value to a CSV
For example, I have a list of field values

Then for each of these values, I will use them in a search query

list = [1,2,3]

for LIST_VALUE in list:
"index="foo" source="bar"
where name=<LIST_VALUE>

outputcsv <LIST_VALUE>.csv 

Is this possible? Thanks!

Tags (1)
0 Karma

to4kawa
Ultra Champion

use map command

Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...