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.

 

 

Labels (1)
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!

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...

Get the T-shirt to Prove You Survived Splunk University Bootcamp

As if Splunk University, in Las Vegas, in-person, with three days of bootcamps and labs weren’t enough, now ...

Wondering How to Build Resiliency in the Cloud?

IT leaders are choosing Splunk Cloud as an ideal cloud transformation platform to drive business resilience,  ...