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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...