From: Siraaj Khandkar <siraaj@khandkar.net>
Date: Mon, 2 Nov 2020 11:49:08 +0000 (-0500)
Subject: Limit loggers report to top 5
X-Git-Url: https://git.xandkar.net/?a=commitdiff_plain;h=828524b279cdc4e4b9e60cf27a819272c750dd42;p=khome.git

Limit loggers report to top 5
---

diff --git a/home/lib/login_functions.sh b/home/lib/login_functions.sh
index 6b01d49..8057711 100644
--- a/home/lib/login_functions.sh
+++ b/home/lib/login_functions.sh
@@ -569,7 +569,7 @@ motd() {
 
     echo
 
-    echo 'Loggers'
+    echo 'Loggers (top 5)'
     awk '
         {
             split($5, prog, "[")
@@ -589,6 +589,7 @@ motd() {
                 print count[prog], total, prog
         }' \
     | sort -n -k 1 -r \
+    | head -5 \
     | bar_gauge -v width=30 -v num=1 -v ch_left=' ' -v ch_right=' ' -v ch_blank=' ' \
     | column -t \
     | indent "${indent_unit}"