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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...