[ale] Using access_logs to get counter info
Gary Maltzen
maltzen at mm.com
Thu Jul 27 10:33:54 EDT 2000
To count the number of lines containing the phrase "images/patman.gif":
grep "images/patman.gif" /var/log/httpd/access_log | wc -l
To do this for all access logs (without compressed logs)
grep "images/patman.gif" /var/log/httpd/access_log* | wc -l
To do this for all access logs (compressed logs)
(grep "images/patman.gif" /var/log/httpd/access_log & \
zgrep "images/patman.gif" /var/log/httpd/access_log*gz) | \
wc -l
> I am running Apache 1.3.9 on Redhat 6.1, and wanted to use my access_logs
> to keep a count of how many times certain files in specific directories
> show up as being accessed in the access_logs. I have a few webpages with
> lots of photos on them, and would like to find a way to see how many hits
> I get for each page of photos (which are sorted and placed in different
> directories per page).
>
> I would like to key off the directory name, and how many times a
> directory name shows up as being accessed from the access_logs. This
> would give me the hit info I want. I already have a counter that counts
> just the number of page accesses per page on each page, but this isn't
> feasible on a per-photo-file basis. Once I get this "number of hits" per
> directory according to the access_logs, I'd like to display number on each
> page too.
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.
More information about the Ale
mailing list