0

I have a nginx server set, it proxies request based on Host field. I have a common log for it, because per-host logging is done at the server, to which I do proxy_pass.

So, is there any solution to analyze and see combined stats?

Tried so far:

  • awstats
  • webalizer
  • goaccess
  • visitors

All listed solution require me to generate separate report (maybe from one log) for each site. I want to see a full report of my access.log for all virtual hosts, generating a separate report for each virtual host is a mess - there is a lot of hosts, they are changing rapidly.

There was a semi-solution: to trick webalizer and make him treat Host as visitor. Not very userful.

maniaque
  • 710
  • 2
  • 5
  • 13
  • GoAccess allows you to parse the whole `access.log` aggregating all the stats, no need to generate separate reports for each virtual host. If I understand your question, just run it against the log, `goaccess -f access.log` – Kayla Jul 31 '14 at 12:49

1 Answers1

1

The trick I've used in the past is a simple preprocessor to merge the Host and the request URL, which will then work in any log analyser.

I.e. modify the stock combined-access_log format that most analysers seem to support to include the host. Then before running your stats run the pre-processor; so that what would normally look like:

199.58.86.209 - - [25/Jul/2014:16:12:41 +0200] "GET /robots.txt HTTP/1.0" 200 291
199.58.86.209 - - [25/Jul/2014:16:12:44 +0200] "GET /robots.txt HTTP/1.0" 200 291

which will be aggregated as two hits on the /robots.txt file, gets converted so converted so you'll see two unique URL's:

199.58.86.209 - - [25/Jul/2014:16:12:41 +0200] "GET www.example.com/robots.txt HTTP/1.0" 200 291
199.58.86.209 - - [25/Jul/2014:16:12:44 +0200] "GET web.example.org/robots.txt HTTP/1.0" 200 291
HBruijn
  • 72,524
  • 21
  • 127
  • 192