Splunk Dev

How to count the number of values?

raghul725
Explorer

Hello

I would like to count the number of values every time the search matches the string  alternativeIdValue- i.e. after the = count the values separated by ,

 

alternativeIdValue=IE778898,WX888889,IS89657578,XS76575889.............................................

 

The length of each value can be different and  the only common pattern is they are separated by comma and they start with an alphabet.

 

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Assuming alternativeIdValue is already a field, try this

| eval count=mvcount(split(alternativeIdValue,","))
0 Karma
Get Updates on the Splunk Community!

Say goodbye to manually analyzing phishing and malware threats with Splunk Attack ...

In today’s evolving threat landscape, we understand you’re constantly bombarded with phishing and malware ...

AppDynamics is now part of Splunk Ideas

Hello Splunkers, We have exciting news for you! AppDynamics has been added to the Splunk Ideas Portal. Which ...

Advanced Splunk Data Management Strategies

Join us on Wednesday, May 14, 2025, at 11 AM PDT / 2 PM EDT for an exclusive Tech Talk that delves into ...