Splunk Search

Manipulating data in a Values() output

chandlercr
New Member

Is there any sort of syntax for me to be able to manipulate or get data on data that exists in the Values() field.

So lets say that I do a

| stats values(dest_port) by src_ip

I then want to order the values in the values(dest_port), or I only want the top 10 of the list in values(), or I want to only get the top and bottom. Is there any sort of notation or syntax that I can use to do this?

0 Karma

sduff_splunk
Splunk Employee
Splunk Employee

Once you use values(), your fields become multi-value. There are numerous functions that can be applied to these sorts of fields, check out https://docs.splunk.com/Documentation/Splunk/7.2.5/SearchReference/MultivalueEvalFunctions

If you want to sort the data, use eval sorted=mvsort(data). If you want the first 10 events, you can use eval first10 = mvindex(data,0,9)

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...