Splunk Search

Search for events with multiple field values

mikelanghorst
Motivator

I have events that I'm joining together via transaction. Once in a transaction a field can have multiple values. How can I then search for only transactions that have more than 3 values for that field?

0 Karma
1 Solution

emotz
Splunk Employee
Splunk Employee

Try mvcount()

from the docs
mvcount(X) This function takes an field X and returns the number of values of that field if the field is multivalued, 1 if the field is single valued, and NULL otherwise.

Example: ... | eval n=mvcount(multifield)

View solution in original post

emotz
Splunk Employee
Splunk Employee

Try mvcount()

from the docs
mvcount(X) This function takes an field X and returns the number of values of that field if the field is multivalued, 1 if the field is single valued, and NULL otherwise.

Example: ... | eval n=mvcount(multifield)

mikelanghorst
Motivator

much cleaner than the other method I was using. Thanks!

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