Grep IP addresses from Plesk Server

Want to see the number and list of IP addresses in the access log for a Plesk Domain?


cd /var/www/vhosts/domainname.com/statistics/logs
sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/' -e t -e d access_log | sort | uniq -c

You should see a list like this…


30 100.3.125.44
4 101.226.65.105
6 103.6.190.208
11 105.227.211.73
168 107.213.9.254

For all Plesk access logs

# cd /var/log/httpd
# sed -e 's/\([0-9]\+\.[0-9]\+\.[0-9]\+\.[0-9]\+\).*$/\1/' -e t -e d access_log | sort | uniq -c

Leave a Comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.