Count the amount of ip`s in the apache log and create top 10.

Count the amount of ipadresses in the access log of apache and create a top 10 of the most common adresses.

cat /home/vhosts/*/logs/access_log | awk ‘{ print $1 }’ | sort -n | uniq -c | sort -rn | head
Or for plesk:
cat /var/www/vhosts/*/statistics/logs/access_log | awk ‘{ print $1 }’ | sort -n | uniq -c | sort -rn | head

Gr gr

Leave a Reply

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