So, If you need to look through an apache access log and count how many IP addresses there are this is how:
root@sertechs [~]# cd /usr/local/apache/logs/
root@sertechs [~]# cat access_log | awk ‘{print$1}’ | sort | uniq -c | sort -nr | less
So this command will write out your access file to screen, use awk to print the first column, sort it, get the unique values, then sort it with a count, and print to “less”.
Very useful to see if your being scraped!
Tagged: Counting Ips, Linux, Security
