From df6ee26506fb1b1c54a99d59ae0dbe5a5fbac148 Mon Sep 17 00:00:00 2001 From: Rhys Smith Date: Wed, 28 Sep 2016 16:01:58 -0400 Subject: [PATCH] Add top 10 IdPs logging into test SP in monthly stats output --- utilities/stats-generate.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/utilities/stats-generate.sh b/utilities/stats-generate.sh index 94ba71f1..17f1862a 100755 --- a/utilities/stats-generate.sh +++ b/utilities/stats-generate.sh @@ -394,6 +394,10 @@ testsplogincount=$(grep $date $logslocation/test-sp/shibd.log* | grep "new sessi # And from how many unique IdPs? testspidpcount=$(grep $date $logslocation/test-sp/shibd.log* | grep "new session created" | cut -f 12 -d " " | sort | uniq | wc -l | awk '{ printf ("%'"'"'d\n", $0) }') +# Top 10 IdPs used to log into the Test SP +testsptoptenidpsbycount=$(grep $date $logslocation/test-sp/shibd.log* | grep "new session created" | awk '{print $12}' | cut -d "(" -f 2 | cut -d ")" -f 1 | sort | uniq -c | sort -nr | head -10) + + # ===== # = Now we're ready to build the message. Different message for daily vs month/year # ===== @@ -467,6 +471,8 @@ else msg+="\n-----\n" msg+="Test SP usage:\n" msg+="-> $testsplogincount logins from $testspidpcount IdPs.\n" + msg+="\nTop 10 IdPs logged in from:\n" + msg+="$testsptoptenidpsbycount\n" msg+="\n-----" fi