The setup:
2 or more nginx machines
each machine has the same virtual hosts
traffic is load balanced via DNS to each machine
I need to figure out what are the best tools to use to get some traffic stats, mostly interested in amount of hits and total traffic in gigabytes. Obviously, the log information will come from nginx, formatted like this:
log_format main '$remote_addr $host $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" "$http_user_agent" "$gzip_ratio"';
awstats is definitely the tool for the job.
rsync logs (or share nfs if you're feeling brave) to one location then use awstats to analyse.
Regardless of which analytics program you intent to use, logresolvemerge.pl is almost certainly going to be your winner for merging the logs themselves. In addition to Marco's listed syntax for awstats, it works like a champ as a standalone program along the lines of: