Splunk Search

mvfind for the last value

pkashou
Explorer

It seems that mvfind will only return the index of the first matching value. I would like to return the index of the last matching value within an MV field. Thanks!

Tags (1)
0 Karma

pkashou
Explorer

I found the answer. I create a MV field for just the value I am interested in, determine the total count, and then return the value at the index of count-1.

eval txKV = mvfilter(match(kvPair, "tx_success")) |
eval txCount = mvcount(txKV) |
eval txTime = mvindex(txKV, txCount-1) |
0 Karma
Get Updates on the Splunk Community!

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...