A snippet for the people who need it
A snippet for the people who need it:
awk '{print $1}' /var/log/nginx/access.log | sort | uniq -c | sort -nr | head -20
I use this to identify e.g. the top 20 IPs causing the most traffic, for example when a bot hammers one of my servers.