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!

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...