Find IPs Accessing your Site Most
List IPs that have made requests to an Apache server in ascending order based on the number of requests.
{ cat /var/log/httpd/access.log!(*.gz) & gzip -dc /var/log/httpd/access.log.*.gz; } \
| cut -d ' ' -f 1 | sort | uniq -c | sort -n
337 8.29.198.25
351 8.29.198.26
379 66.249.68.8
464 185.254.196.115
986 111.229.204.148
List IPs that have made requests to an Nginx server in ascending order based on the number of requests.
{ cat /var/log/nginx/access.log!(*.gz) & gzip -dc /var/log/nginx/access.log.*.gz; } \
| cut -d ' ' -f 1 | sort | uniq -c | sort -n
288 66.249.68.5
298 8.29.198.27
301 154.54.249.206
324 46.101.63.152
329 71.193.139.232
Both commands look at uncompressed and compressed access logs.