You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Debajit Adhikary <de...@outlook.com> on 2015/03/11 23:10:58 UTC

[users@httpd] CustomLog fails when piped to sed

I am trying to use a piped CustomLog to filter my logs:
httpd.conf:CustomLog "|/bin/sed -r s/pass/REDACTED/g >> /workplace/tmp/access.log" common 
However, when I make a request to Apache, I get an error saying/bin/sed: can't read >>: No such file or directory 
How can I get this working? (It seems others have been able to use piped CustomLog like this)

 		 	   		  

Re: [users@httpd] CustomLog fails when piped to sed

Posted by Yann Ylavic <yl...@gmail.com>.
On Thu, Mar 12, 2015 at 12:03 AM, Yann Ylavic <yl...@gmail.com> wrote:
>
> With Apache 2.4.x, you probably have to use :
>
> CustomLog "$|/bin/sed -r s/pass/REDACTED/g >> /workplace/tmp/access.log" common

Oups, I meant "|$...", with the $ *after* the |.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] CustomLog fails when piped to sed

Posted by Yann Ylavic <yl...@gmail.com>.
On Wed, Mar 11, 2015 at 11:10 PM, Debajit Adhikary <de...@outlook.com> wrote:
>
> CustomLog "|/bin/sed -r s/pass/REDACTED/g >> /workplace/tmp/access.log" common
>
> However, when I make a request to Apache, I get an error saying
>
> /bin/sed: can't read >>: No such file or directory
>
> How can I get this working? (It seems others have been able to use piped
> CustomLog like this)

With Apache 2.4.x, you probably have to use :

CustomLog "$|/bin/sed -r s/pass/REDACTED/g >> /workplace/tmp/access.log" common

Note the leading $ so that a shell is used (see
http://httpd.apache.org/docs/2.4/logs.html#piped).

Regards,
Yann.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org