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

I have a web site that has some content protected via apache basic authentication.

Is there a way for me to tell (from the access logs perhaps?) how many users are actually using the login?

Intranet traffic is excluded from having to log in, so I can't just look at how many people are accessing those pages.


share|improve this question
up vote 3 down vote accepted

The default log format includes the HTTP authentication username (the %u format string), so you can achieve this by processing your access logs. It is inserted as the third part of the line, so the following script will output the number of requests made by each authenticated user.

awk '{print $3}' access.log | sort | uniq -c
share|improve this answer
Awesome. Worked perfectly. Thanks. – nedlud May 23 '12 at 5:55

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.