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!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...