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 liked this post, 🗞 subscribe to my newsletter and follow me on 𝕏!