Extract unique IP addresses from an apache log

extract all IP addresses from my httpd log
XXX.64.70.XXX - - [26/Mar/2011:00:28:23 -0700] "GET / HTTP/1.1" 403 4609 
"-" "Mozilla/5.0 (X11; U; Linux i686; en-US) AppleWebKit/534.16 (KHTML, like 
Gecko) Chrome/10.0.648.204 Safari/534.16"

Code:
$ awk '{ print $1 } ' apache_log
Next step is to sort IP addresses with sort command:
Code:
$ awk '{ print $1 } ' apache_log | sort
And finally we get only unique IP address by streaming the output of the above command to uniq:

Code:
$ awk '{ print $1 } ' apache_log | sort | uniq
This will create a long list of short IP addresses, each on separate line. If you intend to count unique visitors on your page simply redirect the output to wc -l.
Code:
$ awk '{ print $1 } ' apache_log | sort | uniq | wc -l