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!

Stay Connected: Your Guide to July Tech Talks, Office Hours, and Webinars!

What are Community Office Hours?Community Office Hours is an interactive 60-minute Zoom series where ...

Updated Data Type Articles, Anniversary Celebrations, and More on Splunk Lantern

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

A Prelude to .conf25: Your Guide to Splunk University

Heading to Boston this September for .conf25? Get a jumpstart by arriving a few days early for Splunk ...