mercredi 28 août 2013

Parser de log Apache en Awk

Un petit script awk (1 ligne) pour afficher toutes les pages qui n'ont pas un code http 200 :

awk '{if ($9 != "200") {a[$7"$"$9]+=1} } END{for (i in a) {split(i,b,"$" ); print  a[i] " " b[1] " " b[2] " " } }'  /var/log/httpd/access_log

Aucun commentaire:

Enregistrer un commentaire