Last Updated: February 25, 2016
·
176
· myniva

Find distinct IP addresses in a (httpd) log file

Recently, I had to get a distinct list of IP addresses that have accessed a webserver. This is how I solved it with some simple pipes:

less /var/log/httpd/logfile | cut -d' ' -f 1 | sort | uniq