Splunk Search

Trying to get the first 10 events based on sourcetype

Runals
Motivator

I'm trying to get the first 10 or so events per sourcetype but the methodology is escaping me. You can't simply use the head command. I also am wanting all fields in the event so can't do something like | top 10 by sourcetype as that doesn't specify any fields. Any thoughts?

Tags (2)
0 Karma
1 Solution

kaufmanm
Communicator

You can use the dedup command to only keep 10 of each sourcetype, returning the full events:

* | dedup 10 sourcetype

View solution in original post

kaufmanm
Communicator

You can use the dedup command to only keep 10 of each sourcetype, returning the full events:

* | dedup 10 sourcetype

Runals
Motivator

Outstanding! thanks much.

0 Karma
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

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