One-liner: how to show the top 5 web-server user IP-addresses

cat /var/log/apache2/access.log | 
awk ' {conn[$1]++;} END { for ( i in conn ) print conn[i],"",i;}' |
sort -nr | head

NB: the feline abuse is intentionally left for simplicity and modularity.

Leave a Reply

Your email address will not be published. Required fields are marked *