Count IP address in Nginx access logs

Recently, many referer spam hit on my server, below is the command I used to find and count the IP Address from a Nginx access log file. $ sudo awk ‘{print $1}’ /var/log/nginx/access.log | sort | uniq -c | sort -nr Full example. $ sudo awk ‘{print $1}’ /var/log/nginx/access.log | sort | uniq -c | …

Read more