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!

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, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...