Splunk Search

How can I make mvfind start its search at the last entry of a multivalue field ?

fere
Path Finder

Hi,
I have a search query that creates trans:
......| eval locale=case(tags=="my-world", "my-world:".screen, tags=="community-world", "community-world:".screen , tags=="puzzle","Puzzles:".screen, tags=="store", "", screen="main-menu", "main-menu") | eval locale=if(isnull(locale), event, locale) | sort sessionId -seqx | transaction sessionId connected=t mvlist=t keepevicted=t keeporphans=t | eval loc==mvfind(locale,"[a-z]$")

I am trying to find the last entry in the mvfield locale that has any text (note {tags=="store", "" } in the query causes some local values to be = "" ). Basically I need to grab the value of the last value in the mvfield locale that is <> "".

mvfind(locale,"[a-z]$") applies the $ to the end of each entry which is not what I need.

Appreciate your quick help.

Tags (1)
0 Karma

fere
Path Finder

I got around the issue by building my transaction in the reverse order.

0 Karma

fere
Path Finder

No, not really.

0 Karma

martin_mueller
SplunkTrust
SplunkTrust

Are you possibly looking for this?

... | eval loc=mvindex(locale, -1)
Get Updates on the Splunk Community!

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to ...

Announcing the Migration of the Splunk Add-on for Microsoft Azure Inputs to Officially Supported Splunk ...