Splunk Search

How do you run a script on a column search result?

rolivet
New Member

Hi,

I want to run a script on all values in a column like that:

index="myindex" mysearch_filters | table id | script call_script $id

My py script works when I call |script call_script id1 but I want to do it for every values pf id.
I tried a lot of things without success (using foreach, map, ...).
Can someone tell me how to do that ? Or give me some guidelines ?

Thanks.

Rémy

0 Karma

niketn
Legend

@rolivet can you try with a rather expensive map command? Following example will iterate for 10 ids from the table and then run the script for each id:

index="myindex" mysearch_filters 
| table id 
| map search="| script call_script $id$" maxsearches=10
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...