627 shaares
Quelques commandes pour parser les logs Nginx:
Sort access by Response Codes:
cat access.log | cut -d '"' -f3 | cut -d ' ' -f2 | sort | uniq -c | sort -r
Find out which links are broken:
awk '($9 ~ /404/)' access.log | awk '{print $7}' | sort | uniq -c | sort -r
Find 502 bad-gateway:
awk '($9 ~ /502/)' access.log | awk '{print $7}' | sort | uniq -c | sort -r
Most requested URLs:
awk -F\" '{print $2}' access.log | awk '{print $2}' | sort | uniq -c | sort -r