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!

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...