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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...