Find out how many unique hits on a site based on apache access log

This is a nifty little code snippet in perl which will list out the number of unique IP to hit your site and also the number of hits per IP

perl -e '$ip{(split)[0]}++ while <>; print map "$_ : $ip{$_}\n", sort {$ip{$b} <=> $ip{$a}} keys %ip' access.log
If you have any questions or comments, please post them below. If you liked this post, you can share it with your followers or follow me on Twitter!