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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...