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 App for Anomaly Detection End of Life Announcment

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...