Normalized Apache access log file.

This commit is contained in:
Didier Clermonté 2019-08-14 17:01:24 +02:00 committed by root
parent 6688d8153d
commit 8c8a7c59d4

View File

@ -37,13 +37,13 @@ generateReport()
local yearMonth="$3" local yearMonth="$3"
echo -e "=================================================================" echo -e "================================================================="
echo echo
httpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep -c "$year") httpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-access.log*|grep -c "$year")
echo "Nombre total de requêtes http = $httpRequestCount" echo "Nombre total de requêtes http = $httpRequestCount"
trueHttpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -c -v check) trueHttpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -c -v check)
echo "Nombre de vraies requêtes http = $trueHttpRequestCount" echo "Nombre de vraies requêtes http = $trueHttpRequestCount"
botRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -i bot|grep -c -v check) botRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-access.log*|grep "$year"|grep -i bot|grep -c -v check)
echo "Nombre de requêtes bot = $botRequestCount" echo "Nombre de requêtes bot = $botRequestCount"
errorsRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-error.log*|grep -c "$year") errorsRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-error.log*|grep -c "$year")
@ -66,10 +66,10 @@ generateReport()
pasteCount=$(find /var/www/paste.chapril.org/data -mindepth 3 -maxdepth 3 -type f | wc -l) pasteCount=$(find /var/www/paste.chapril.org/data -mindepth 3 -maxdepth 3 -type f | wc -l)
echo "Nombre de pastes dans la base actuellement = $pasteCount" echo "Nombre de pastes dans la base actuellement = $pasteCount"
ipTotalCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -v check_http|cut -d' ' -f1|sort|uniq |wc -l) ipTotalCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|cut -d' ' -f1|sort|uniq |wc -l)
echo "Nombre d'ip visiteuses = $ipTotalCount" echo "Nombre d'ip visiteuses = $ipTotalCount"
ipUtilCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -v "GET /fonts/"|grep -v "GET \(/css/\|/images/\|/ \)"|grep -v "GET /js/"|grep -v "HTTP/1.0\" 404"|cut -d' ' -f1|sort|uniq| wc -l ) ipUtilCount=$(zgrep -h "$monthEnglish" /var/log/apache2/paste.chapril.org/paste.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -v check_http|grep -v "GET /fonts/"|grep -v "GET \(/css/\|/images/\|/ \)"|grep -v "GET /js/"|grep -v "HTTP/1.0\" 404"|cut -d' ' -f1|sort|uniq| wc -l )
echo "Nombre d'ip utilisatrices = $ipUtilCount" echo "Nombre d'ip utilisatrices = $ipUtilCount"
echo -e "\n" echo -e "\n"