Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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

We've got about 30 websites on our server. Some with Google Analytics, some without. They do come with Awstats (server is using WHM). I want to know the total number of unique visitors, serverwide. What is an easy way to go about this? Adding all visitors for every website would also do, but is rather cumbersome. What I do have are monthly logs for every site, so I see some possibility there. I am thinking of a script that would process these individual logs. Does something like that exist? Are there easier ways?

BTW: I do not mind about 'truly' unique visitors or not (i.e. I do not mind if an IP that visited website A and website B is being counted as either 1 or 2), I just want an estimate of the total number of visitors that day.

share|improve this question
up vote 1 down vote accepted

Something like this perhaps:

grep -Po "\d\d?\d?\.\d\d?\d?\.\d\d?\d?\.\d\d?\d?' $logfiles | uniq -c
share|improve this answer
Don't forget to sort before you uniq. – Ladadadada Nov 23 '11 at 7:51

Your Answer


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