Normalized Apache access log file.

This commit is contained in:
Didier Clermonté 2019-08-14 17:02:23 +02:00 committed by root
parent bbe505ed41
commit 51b27b6b73

View File

@ -53,13 +53,13 @@ generateReport()
pollExpiredCount=$(echo "SELECT count(*) from fd_poll where end_date > now();"| mysql --silent -u root date_chapril_org_db)
echo "Nombre de sondages expirés = $pollExpiredCount"
httpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-acces.log*|grep -c "$year")
httpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep -c "$year")
echo "Nombre total de requêtes http = $httpRequestCount"
trueHttpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-acces.log*|grep "$year"|grep -vi bot|grep -c -v check)
trueHttpRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -vi bot|grep -c -v check)
echo "Nombre de vraies requêtes http = $trueHttpRequestCount"
botRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-acces.log*|grep "$year"|grep -i bot|grep -c -v check)
botRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-access.log*|grep "$year"|grep -i bot|grep -c -v check)
echo "Nombre de requêtes bot = $botRequestCount"
errorRequestCount=$(zgrep "$monthEnglish" /var/log/apache2/date.chapril.org/date.chapril.org-error.log*|grep -c "$year")
@ -68,10 +68,10 @@ generateReport()
databaseSize=$(mysql --silent -u root date_chapril_org_db -e "SELECT round(sum(data_length+index_length)/1024/1024,3) AS 'Size (MB)' FROM information_schema.tables WHERE table_schema='date_chapril_org_db';" )
echo "Taille de la base de données = $databaseSize MB"
ipTotalCount=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.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/date.chapril.org/date.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"
ipUtilCount=$(zgrep -h "$monthEnglish" /var/log/apache2/date.chapril.org/date.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/date.chapril.org/date.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 -e "\n"