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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...