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!

Index This | When is October more than just the tenth month?

October 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Observe and Secure All Apps with Splunk

  Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What’s New & Next in Splunk SOAR

 Security teams today are dealing with more alerts, more tools, and more pressure than ever.  Join us for an ...