Apache log analysis tools for multiple virtual hosts

apache-2.2loggingvirtualhost

I am interested in trying to get a side by side usage comparison of all the virtual hosts being served up by my apache server.

In the simplest case, I want to see a list (or bar chart) with each virtual host and the number of requests/traffic on that site.

I've been playing around with webalyzer and awstats but I haven't been able to compare multiple virtual hosts in the same infographic.

Anyone have any suggestions on tools for doing this (or how I might use the above tools to do so)?

Best Answer

Well generally when using virtual hosts I have different access logs for each virtual host. If this is the case and you just want hits:

wc -l foo_vhosts.access*

This counts the lines, which would be log entires, which is basically how many hits you got. But you should describe if you log to different files or not, and post an example log entry.

If you don't log to different files, and your logging format doesn't include %v in its format, you are kind of out of luck, unless you can correlate each uri to its virtual host.