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

We're trying to clean up one of our systems as much as possible & have found that despite our attempts to block, users are accessing a certain part of our system through a HTTP GET with their password in the URL. This results in our Apache logs recording their password in plain text on the server.

Is there an Apache directive or module that can filter out (or replace) certain patterns in its logs?

share|improve this question
Is correcting the way you collect the user passwords not an option for some reason? – HopelessN00b Oct 4 '12 at 7:37
I meant to imply that in the "despite our attempts to block" statement. This is meant to be an additional layer for any external parties that are still attempting to use old mechanisms so that we can say "we don't have your password on file". Kinda like how 'ps' removes passwords from known applications despite the fact that you shouldn't be entering passwords in plaintext on the CLI. – Mark McDonald Oct 4 '12 at 8:33
up vote 3 down vote accepted

Create a LogFormat that has the details you want and then apply it to that virtual host, or the entire web server as desired.

If you need to filter out even more information, then use Apaches ability to write its logs to a pipe instead of a file. Hack yourself up some quick script that applies some regex or whatever to filter out whatever you like.

share|improve this answer
Pipe to sed sounds like it would work if there's no native Apache solution. – Mark McDonald Oct 4 '12 at 8:56
Actually - I'll accept & call this off now. Already asked & answered over on SO:… – Mark McDonald Oct 4 '12 at 8:56

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.