Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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"';
share|improve this question

awstats is definitely the tool for the job.

share|improve this answer
awstats includes which will merge and timesort the log before handing it to awstats. LogFile="/usr/share/doc/awstats/examples/ /gfs/weblogs/c1ws*-vcommon-access.log.1|" – user6738237482 Jun 17 '10 at 7:59

rsync logs (or share nfs if you're feeling brave) to one location then use awstats to analyse.

share|improve this answer

Regardless of which analytics program you intent to use, 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:

/path/to/ /path/to/one/big/logfile /path/to/many/files/ending/in/*.log > /path/to/merged/log.file
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.