My company hosts an open source RPM repository and would like to start counting RPM downloads per day. The repository is hosted on Apache httpd. Can anyone recommend a good way to count the downloads of just the RPM files (which will have URLs of the form http://packages.mycompany.com/packages/continuous/trunk/fedora/10/RPMS/package1.rpm) while excluding any other accesses to the repository URLs for index browsing, etc. ?
visitors -o text ACCESS.LOG | grep " /" | grep ".rpm"
will give you a list of requested RPMs sorted by popularity with the number of downloads included after the file name. Non-RPM downloads will be ignored, so the order might look a little funny.
The simplest answer would be something along these lines:
grep ".rpm" /var/log/httpd/access_log | wc -l
This would give you the number of files accessed with .rpm in their name. Simple I know, but effective.