Splunk Search

Get the last n distinct fields, or n random fields

brettcave
Builder

Is there an aggregation function (e.g. via stats or chart) that is a sort of combination of last and list? I want to get the 20 most recent occurences of a field, or 20 rand values of a field:

eventtype="WebAnalytics" | stats limited_list(SessionID, 20)

Some how get the first 20 or last 20 session IDs. "top" gets close to it, but I don't necessarily want to use the most commonly occurring fields, so its a type of search I could add in a ... | dedup SessionID | last_list...

Tags (2)
0 Karma
1 Solution

brettcave
Builder

found head and can use this with sort

View solution in original post

brettcave
Builder

found head and can use this with sort

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...