Sunday, May 26, 2013

How popular is my website?

Everyone wants to know.  The logs can tell you.

Locate your apache access log, change to whatever directory it's in, and run the following to find out some cool statistics.

Accesses per minute:
awk '{print $4}' access_log | sed 's/\[//'| cut -f-3 -d: | uniq -c

Accesses per hour:
awk '{print $4}' access_log | sed 's/\[//'| cut -f-2 -d: | uniq -c

Accesses per day:
awk '{print $4}' access_log| sed 's/\[//'| cut -f-1 -d: | uniq -c

No comments:

Post a Comment