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!

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