Splunk Search

How to create a base search that uses values from a multi-value field as indices?

jsven7
Communicator

I have a lookup table. Let's say the lookup table contains a column called "a". The "a" column contains a list of indices.

How can I perform a stats count of logs found in each index from the "a" column?

 

| inputlookup lookuptable.csv
| table a

 

 

Labels (4)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

If I understand the question, this may help.  

| inputlookup lookuptable.csv 
| fields a
| mvexpand a
| map search="search index=$a$"
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

If the field is not multivalue then mvexpand will not do anythihg to it.

---
If this reply helps you, Karma would be appreciated.
0 Karma

richgalloway
SplunkTrust
SplunkTrust

If I understand the question, this may help.  

| inputlookup lookuptable.csv 
| fields a
| mvexpand a
| map search="search index=$a$"
---
If this reply helps you, Karma would be appreciated.
0 Karma

jsven7
Communicator

@richgalloway  - thanks Rich. May I ask, what if some of the values are multivalued, pipe-deliminated values. How may I make $a$ single-valued?

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...