Splunk Search

how to fetch upperbound value from Multi-value field

rsathish47
Contributor

Hi All,

I have multi-value field, I need to fetch last that mean upper bound value from Multi-value field. Length of the field will not be same ;(

Please help how to fetch upperbound value from Multi-value field.

Thanks
Sathish R

Tags (2)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

Take a look at this:

| stats count | eval mv = "a b c d" | makemv mv | eval last = mvindex(mv, -1)

Calling mvindex(field, -1) will give you the last value regardless of length.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

Take a look at this:

| stats count | eval mv = "a b c d" | makemv mv | eval last = mvindex(mv, -1)

Calling mvindex(field, -1) will give you the last value regardless of length.

martin_mueller
SplunkTrust
SplunkTrust

That'll work as well, but is a bit harder to maintain and might run slower too 😛

0 Karma

rsathish47
Contributor

thanks Marty.. i used like mentioned below

eval sa=mvindex(test,mvcount(test)-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 ...