Use 'grep -c' instead of 'wc -l'

This commit is contained in:
Pierre-Louis Bonicoli 2024-06-17 02:03:02 +02:00
parent 4c8d0de5ba
commit 9f6b588083
Signed by: pilou
GPG Key ID: 06914C4A5EDAA6DD

View File

@ -50,10 +50,10 @@ generateHTTPReport()
echo "=§= Rapport d'activité HTTP" echo "=§= Rapport d'activité HTTP"
echo echo
local httpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|wc -l) local httpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep -c $year)
echo "Nombre total de requêtes http = $httpRequestCount" echo "Nombre total de requêtes http = $httpRequestCount"
local trueHttpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|grep -vi bot|grep -v check_http|wc -l) local trueHttpRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep $year|grep -vi bot|grep -c -v check_http)
echo "Nombre de vraies requêtes http = $trueHttpRequestCount" echo "Nombre de vraies requêtes http = $trueHttpRequestCount"
local botRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -i bot|grep -c -v check_http) local botRequestCount=$(zgrep "$monthEnglish" $LOG_PREFIX-access.log*|grep "$year"|grep -i bot|grep -c -v check_http)