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!

Automatic Discovery Part 1: What is Automatic Discovery in Splunk Observability Cloud ...

If you’ve ever deployed a new database cluster, spun up a caching layer, or added a load balancer, you know it ...

Real-Time Fraud Detection: How Splunk Dashboards Protect Financial Institutions

Financial fraud isn't slowing down. If anything, it's getting more sophisticated. Account takeovers, credit ...

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...