Show number of requests made by different IPs, by analysing nginx log

from blog heyman.info, | ↗ original
Here’s a small command that uses awk, sort and uniq to see the number of requests made to an nginx server, aggregated by IP, and sorted by the number of requests made. tail -n 300000 /var/log/nginx/access.log | awk '{print $1}' \ | sort | uniq -c | sort -n Can be useful to see who is crawling your website. The tail’s -n parameter specifies how...