Splunk Search

top n by servicename

DTERM
Contributor

I have a splunk instance with many serviceName's in the logs. Is there a query where I can extract the top 15 of each serviceName? My service names include data such as snmp, syslog, etc. I want the top 15 of each type

Thanks.

Tags (1)
0 Karma
1 Solution

lguinn2
Legend

I am not sure that I understand the results that you want. If you want to see the 15 most common serviceNames, try this

<your search> | top limit=15 serviceName

This will show the most common 15 serviceNames, along with the number of events for each serviceName. The results are displayed in a table. If you click on a row of the table, you will see the underlying events for the corresponding serviceName.

View solution in original post

lguinn2
Legend

I am not sure that I understand the results that you want. If you want to see the 15 most common serviceNames, try this

<your search> | top limit=15 serviceName

This will show the most common 15 serviceNames, along with the number of events for each serviceName. The results are displayed in a table. If you click on a row of the table, you will see the underlying events for the corresponding serviceName.

hazekamp
Builder

Splunk's dedup command is right for the job:

<your search> | dedup 15 serviceName
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...