Splunk Search

top results when using a chart command

rakesh_498115
Motivator

Hi ,

I have query which uses the chart command . Now i need only top ten values to be displayed for that query . used top but didnt get the proper results.

sourcetype="X" | eval a=mvfilter(eventtype LIKE "%_Metrics") |stats count by UniqueID,a |chart sum(count) by UniqueID,a | fillnull value="0"

here a contains the eventtypes

my results are something likethis..

UniqueId A_metrics B_metrics C_metrics
abc 0 56 0
sds 34 5 94
dss 0 53 39
ere 24 45 19
....
...
...

I need to display only the count top 10 UniqueId's..How can i do tat ?? Used top at the bottom but couldnt the same result as above..please help.

Tags (2)
0 Karma
1 Solution

Mahieu
Communicator

Try adding this :
| addtotals | head 5| fields  – Total

View solution in original post

Mahieu
Communicator

Try adding this :
| addtotals | head 5| fields  – Total

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