* David Haller [19-03-2008 00:55]: > >$ awk '{ print $1 }' /var/log/apache2/access.log | uniq | wc -l > >9 > >$ awk '{ print $1 }' /var/log/apache2/access.log | sort | uniq | wc -l > >3 > > Och, das kann gawk doch auch alles selber (auch das grep): Welches grep? ;-) > awk ' > /^([0-9]+\.)+/ { > ips[$1]++; > } > END { > for( i in ips ) { > printf("%10i: %s\n", ips[i], i); > } > }' /var/log/apache2/access.log > > Ansonsten hilft auch 'uniq -c' ;) Das ist eine gute Idee, aber da würde mir auch das sort fehlen: $ awk '{print $1}' /var/log/apache2/access.log | sort | uniq -c Gibt eine schöne Statistik aus. :-) Gruß Uwe
Attachment:
signature.asc
Description: Digital signature