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
Written by Basil Brunner
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Shell
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#