Splunk Search

How do I get top 10 values of output based on "count(_raw)' values displayed in descending order?

zacksoft
Contributor

My query ends with

 | stats count(_raw) by user

 I want the values to be displayed in descending order based on the "count(_raw)' values.
Tags (1)
0 Karma
1 Solution

harsmarvania57
Ultra Champion

Hi @zacksoft,

Try below query

<yourBaseSearch>
| stats count(_raw) as count by user
| sort limit=10 -count 

View solution in original post

mstjohn_splunk
Splunk Employee
Splunk Employee

hi @zacksoft

Did the answer below solve your problem? If so, please resolve this post by approving it!
If your problem is still not solved, keep us updated so that someone else can help ya. Thanks for posting!

0 Karma

harsmarvania57
Ultra Champion

Hi @zacksoft,

Try below query

<yourBaseSearch>
| stats count(_raw) as count by user
| sort limit=10 -count 
Get Updates on the Splunk Community!

Community Content Calendar, November Edition

Welcome to the November edition of our Community Spotlight! Each month, we dive into the Splunk Community to ...

October Community Champions: A Shoutout to Our Contributors!

As October comes to a close, we want to take a moment to celebrate the people who make the Splunk Community ...

Stay Connected: Your Guide to November Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...