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!

Index This | What goes away as soon as you talk about it?

May 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this month’s ...

What's New in Splunk Observability Cloud and Splunk AppDynamics - May 2025

This month, we’re delivering several new innovations in Splunk Observability Cloud and Splunk AppDynamics ...

Getting Started with Splunk Artificial Intelligence, Insights for Nonprofits, and ...

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