How to show Top N results in Splunk stats query?

How to show Top N results in Splunk stats query?

head can be used in the Splunk Query to show Top N results.

Sample Query:

< Your Basic Search >
| stats count as total by field 
| sort -total | head 10

In the above Splunk Query, it will shot top 10 stats for events count grouped by the field.

Leave a Reply