Splunk Search

How to calculate the number of times a value appear in a multi value field?

architkhanna
Path Finder

Hi All,

Is there a way we can calculate the number of times a value appear in a multi value field into a separate field?

TIA

Labels (1)
0 Karma

acharlieh
Influencer

Hand jamming on my phone from the docs, Assuming a known static value that’s being compared against: 

    ... | eval count=mvcount(mvfilter(mvfieldname="staticvalue"))


Assuming Splunk 8 and the comparison is against different single value field in each row...

    ... | eval mvresults=mvmap(mvfieldname,if(mvfieldname=svfieldname,"Y","N")), count=mvcount(mvfilter(mvresults="Y"))

see: https://docs.splunk.com/Documentation/Splunk/8.0.5/SearchReference/MultivalueEvalFunctions

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 ...