get info by week

This commit is contained in:
Valentin CZERYBA 2023-01-22 21:28:39 +01:00
parent 0b614d02a8
commit 1239415279

View File

@ -26,11 +26,13 @@ do
cat $directory_host/output_*.txt |grep "${j}" |sort |uniq -c >> ${MAIL}
echo "--------------" >> ${MAIL}
done
echo "nombre erreur 400 par IP : " >> ${MAIL}
cat $log_access | awk -F "|" '{ if($2 == "400") print $1}' |sort |uniq -c >> ${MAIL}
echo "--------" >> ${MAIL}
echo "nombre erreur 404 par IP : " >> ${MAIL}
cat $log_access | awk -F "|" '{ if($2 == "404") print $1}' |sort |uniq -c >> ${MAIL}
ERROR=("400" "404")
for j in ${ERROR[@]}
do
echo "nombre erreur ${j} par IP :" >> ${MAIL}
cat $directory_host/${j}_* |sort |uniq -c >> ${MAIL}
echo "----------------" >> ${MAIL}
done
cat ${MAIL} |mail -s "Rapport reverse proxy $DATE" valczebackup@gmail.com
#rm $directory_host/*
done