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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...