Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

Thanks.

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.