From dfa7c6b7e24ef16e94b86d80e242f1e1b10ce6de Mon Sep 17 00:00:00 2001 From: Rhys Smith Date: Wed, 1 Feb 2017 09:17:50 +0000 Subject: [PATCH] Fix MDQ counting by including urn style entityId queries --- utilities/stats-generate.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/utilities/stats-generate.sh b/utilities/stats-generate.sh index 3f09b5cf..bbc6bbf6 100755 --- a/utilities/stats-generate.sh +++ b/utilities/stats-generate.sh @@ -479,7 +479,9 @@ if [[ "$timeperiod" != "day" ]]; then fi # MDQ requests for entityId based names -mdqcountentityid=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/http" | wc -l) +mdqcountentityidhttp=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/http" | wc -l) +mdqcountentityidurn=$(grep $apachesearchterm $logslocation/md/md1/mdq.uou-access_log* $logslocation/md/md2/mdq.uou-access_log* $logslocation/md/md3/mdq.uou-access_log* | grep -Ev "(Sensu-HTTP-Check|dummy|check_http|Balancer)" | grep "/entities" | grep -v "/entities " | grep -v "/entities/ " | grep -v 404 | grep "/entities/urn" | wc -l) +mdqcountentityid=$((mdqcountentityidhttp+mdqcountentityidurn)) if [[ "$mdqcount" -ne "0" ]]; then mdqcountentityidpc=$(echo "scale=3;($mdqcountentityid/$mdqcount)*100" | bc | awk '{printf "%.1f\n", $0}') else