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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...