Splunk Search

statsコマンドで計算した結果の上位何件だけを表示させる方法について

70250939
Explorer

indexに"count"というフィールドがあり、"user"ごとに"count"を合計を出し、数が多い順に表示させています。

|stats sum(count) by user
|sort - sum(count)

数が少ないひとは除外したいため、数が多い上位10名だけ表示させたいとした場合、どのようなコマンドを使えばよろしいでしょうか?
topコマンドなど使用してみたりしたのですが結果が変わってしまったり、うまく表示されなかったりしています。

いい方法ご存知の方アドバイスよろしくお願いいたします。

Tags (2)
0 Karma

vasanthmss
Motivator

English Version of question:

index to have a field called "count", for each "user" and issued a total of "count", you have to appear in the order number is large.

| stats sum (count) by user
| sort - sum (count)

For human small number you want to exclude, if you want to display only a large number top ten, Are you sure you want if you use any kind of command?
top and I was or try to use such as a command or have changed but a result, we have may not be displayed well.

Better advice thank you for a good way you know.

V
0 Karma

vasanthmss
Motivator

try this,

|stats sum(count) as total by user | sort - total | head 10

Cheers!

V

70250939
Explorer

出来ました!ありがとうございました。

0 Karma

vasanthmss
Motivator

hope this helps you.

V
0 Karma
Get Updates on the Splunk Community!

Strengthen Your Future: A Look Back at Splunk 10 Innovations and .conf25 Highlights!

The Big One: Splunk 10 is Here!  The moment many of you have been waiting for has arrived! We are thrilled to ...

Now Offering the AI Assistant Usage Dashboard in Cloud Monitoring Console

Today, we’re excited to announce the release of a brand new AI assistant usage dashboard in Cloud Monitoring ...

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

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