You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dan Poirier <po...@pobox.com> on 2010/01/27 21:02:54 UTC

[users@httpd] Re: mod_log_config issue

Joe Hammerman <jh...@videoegg.com> writes:

> Hello Apache users list.
>
> We have an issue with mod_log_config; specifically we are trying to pipe log output through Sed before it goes to Cronolog. The result is that we get no output whatsoever.
>
> Here is a sample of the directives we are using in our VirtualHost container:
>
>     CustomLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log
>
>     ErrorLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/error_log"
>
> We have also experimented with writing a wrapper script that performs all three of the above functions - the result is the same.
>
> Does anyone have any input? Is what we are attempting possible?

What's the simplest case that doesn't work?  What if you take out the
whole 'sed' command and just use /bin/cat?  Does invoking cronolog with
sudo work when not receiving input piped from another command?  Does it
work with a simpler sed script?


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Some background information on our use case (Was mod_log_config issue)

Posted by Joe Hammerman <jh...@videoegg.com>.
So perhaps someone on the users list has an alternative method for addressing the issue we are encountering.

Our setup is that we have Amazon EC2 instances serving our web content. If we logged the request host IP, we would have a log filled with the IP's of the Amazon load balancers. Therefore, we use the XFF HTTP header in our logs.

The issue we are encountering is that if a client makes a request from behind a proxy, the proxy's IP is logged as well. We want to strip out all of the proxy IP's and only record the client IP.

This is what we were hoping to utilize Sed for in our Custom log set up.

Any and all input is appreciated!

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Re: mod_log_config issue

Posted by Joe Hammerman <jh...@videoegg.com>.
Hey all. First of all thanks for the assistance.

I haven't resolved the issue, however I thought I would add some more detail regarding my investigations, if anyone ever digs through these archives.

It seems that sed doesn't actually flush the stream it is editing until it hits a '\n'. So I bet sed is editing the stream in place, and storing all of its edits in memory.

LogFormat supports the '\n' character - but I still can't get sed to actually write out to disk.

-----Original Message-----
From: Joe Hammerman [mailto:jhammerman@videoegg.com] 
Sent: Thursday, January 28, 2010 11:47 AM
To: users@httpd.apache.org
Subject: RE: [users@httpd] Re: mod_log_config issue

Hi Dan,

When the sed command is replaced with /bin/cat, logs are generated. Using a sed command that does nothing results in no log output; e.g.

CustomLog "| /bin/sed s/// |/usr/bin/cronolog..."

Or

CustomLog "| /bin/sed 's///' | /usr/bin/cronolog..."

Or

CustomLog "| /bin/sed -e 's///' | /usr/bin/cronolog..."

:/

I have tried using a wrapper script. Here it is in its original form:

#!/bin/bash

cat - | while read LINE
do
echo ${LINE} |
/bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/access_log
done

and then, per your suggestion:

#!/bin/bash

#cat - | while read LINE
#do
#echo ${LINE} |
/bin/sed s/[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\},\\
//g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/
logs/beacon/%Y%m%d/%H/access_log
#done


httpd.conf was configured as you said.

In either case, no logs are generated.

-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
Sent: Thursday, January 28, 2010 7:10 AM
To: users@httpd.apache.org
Subject: [users@httpd] Re: mod_log_config issue

Joe Hammerman <jh...@videoegg.com> writes:

> 	If we replaced Sed with Cat, I'm a little confused as to what we would be catting; there's a stream coming in, right?
>
> To your second question - yes, logging is fully functional with sudo
>
> To your final question - no, even with a sed command that performs no actions, no logging information is generated.
>
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
> Sent: Wednesday, January 27, 2010 12:03 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Re: mod_log_config issue
>
>> We have an issue with mod_log_config; specifically we are trying to pipe log output through Sed before it goes to Cronolog. The result is that we get no output whatsoever.
>>
>>     CustomLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log
>>
>>     ErrorLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/error_log"
>>
>> We have also experimented with writing a wrapper script that performs all three of the above functions - the result is the same.
>>
> What's the simplest case that doesn't work?  What if you take out the
> whole 'sed' command and just use /bin/cat?  Does invoking cronolog with
> sudo work when not receiving input piped from another command?  Does it
> work with a simpler sed script?

Okay, then you're saying this gives you logging:

     CustomLog "| /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

but this doesn't:

     CustomLog "| /bin/sed | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

How about this:

     CustomLog "| /bin/cat | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

"cat" with no arguments just copies stdin to stdout, so we can tell if sed is the problem, or the piping.

Also, I would think if putting the piped command directly in the log config is the problem, then replacing it with a wrapper script ought to work.  I assume your script looked like:

#!/bin/sh
/bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log

(maybe with one level of backslashes removed), was marked executable, and the full path was configured:

CustomLog "| /path/to/wrapper/script" combined env=survey_log

You might try a simpler script:

#!/bin/sh
/bin/cat >>/path/to/logfile

again just to rule out something funny in the sed/sudo/cronolog part as opposed to Apache.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Re: mod_log_config issue

Posted by Joe Hammerman <jh...@videoegg.com>.
Justin - the wrapper script (in its original form) that I provided in my previous email has been tested in this manner against sample data.

You are correct  about my sed syntax - I have replaced those commands with s/antelope// in the formats provided below, and verified that there is no output.

Editing the scripts referenced below so that they also replace antelope with nothing also results in no output.

Any other thoughts?

-----Original Message-----
From: Justin Pasher [mailto:justinp@newmediagateway.com] 
Sent: Thursday, January 28, 2010 12:18 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] Re: mod_log_config issue

Joe Hammerman wrote:
> Hi Dan,
>
> When the sed command is replaced with /bin/cat, logs are generated. Using a sed command that does nothing results in no log output; e.g.
>
> CustomLog "| /bin/sed s/// |/usr/bin/cronolog..."
> CustomLog "| /bin/sed 's///' | /usr/bin/cronolog..."
> CustomLog "| /bin/sed -e 's///' | /usr/bin/cronolog..."
>   

I haven't really been following this thread in detail, but here are some 
thing I noticed.

All three of the sed commands above are invalid, so it doesn't surprise 
me there is no output.

$ echo "test" | sed s///
sed: -e expression #1, char 0: no previous regular expression
$ echo "test" | sed 's///'
sed: -e expression #1, char 0: no previous regular expression
$ echo "test" | sed -e 's///'
sed: -e expression #1, char 0: no previous regular expression

Since replacing it with cat works, it means the sed command in your 
original code is not working as expected. Try logging directly to a 
file, then run your sed commands or wrapper script on that file (e.g. 
cat this.log > sed -e 's/blah/blah/'). Once you have verified that is 
working properly, then come back to putting it into the apache config.

There is also a chance that the escape sequences for a shell are 
different than those for the apache directive. You can verify that by 
starting out with a much simpler sed script, then expanding from there.

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: mod_log_config issue

Posted by Justin Pasher <ju...@newmediagateway.com>.
Joe Hammerman wrote:
> Hi Dan,
>
> When the sed command is replaced with /bin/cat, logs are generated. Using a sed command that does nothing results in no log output; e.g.
>
> CustomLog "| /bin/sed s/// |/usr/bin/cronolog..."
> CustomLog "| /bin/sed 's///' | /usr/bin/cronolog..."
> CustomLog "| /bin/sed -e 's///' | /usr/bin/cronolog..."
>   

I haven't really been following this thread in detail, but here are some 
thing I noticed.

All three of the sed commands above are invalid, so it doesn't surprise 
me there is no output.

$ echo "test" | sed s///
sed: -e expression #1, char 0: no previous regular expression
$ echo "test" | sed 's///'
sed: -e expression #1, char 0: no previous regular expression
$ echo "test" | sed -e 's///'
sed: -e expression #1, char 0: no previous regular expression

Since replacing it with cat works, it means the sed command in your 
original code is not working as expected. Try logging directly to a 
file, then run your sed commands or wrapper script on that file (e.g. 
cat this.log > sed -e 's/blah/blah/'). Once you have verified that is 
working properly, then come back to putting it into the apache config.

There is also a chance that the escape sequences for a shell are 
different than those for the apache directive. You can verify that by 
starting out with a much simpler sed script, then expanding from there.

-- 
Justin Pasher

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Re: mod_log_config issue

Posted by Joe Hammerman <jh...@videoegg.com>.
Hi Dan,

When the sed command is replaced with /bin/cat, logs are generated. Using a sed command that does nothing results in no log output; e.g.

CustomLog "| /bin/sed s/// |/usr/bin/cronolog..."

Or

CustomLog "| /bin/sed 's///' | /usr/bin/cronolog..."

Or

CustomLog "| /bin/sed -e 's///' | /usr/bin/cronolog..."

:/

I have tried using a wrapper script. Here it is in its original form:

#!/bin/bash

cat - | while read LINE
do
echo ${LINE} |
/bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/access_log
done

and then, per your suggestion:

#!/bin/bash

#cat - | while read LINE
#do
#echo ${LINE} |
/bin/sed s/[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\}\\.[0-9]\\{1,3\\},\\
//g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/
logs/beacon/%Y%m%d/%H/access_log
#done


httpd.conf was configured as you said.

In either case, no logs are generated.

-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
Sent: Thursday, January 28, 2010 7:10 AM
To: users@httpd.apache.org
Subject: [users@httpd] Re: mod_log_config issue

Joe Hammerman <jh...@videoegg.com> writes:

> 	If we replaced Sed with Cat, I'm a little confused as to what we would be catting; there's a stream coming in, right?
>
> To your second question - yes, logging is fully functional with sudo
>
> To your final question - no, even with a sed command that performs no actions, no logging information is generated.
>
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
> Sent: Wednesday, January 27, 2010 12:03 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Re: mod_log_config issue
>
>> We have an issue with mod_log_config; specifically we are trying to pipe log output through Sed before it goes to Cronolog. The result is that we get no output whatsoever.
>>
>>     CustomLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log
>>
>>     ErrorLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/error_log"
>>
>> We have also experimented with writing a wrapper script that performs all three of the above functions - the result is the same.
>>
> What's the simplest case that doesn't work?  What if you take out the
> whole 'sed' command and just use /bin/cat?  Does invoking cronolog with
> sudo work when not receiving input piped from another command?  Does it
> work with a simpler sed script?

Okay, then you're saying this gives you logging:

     CustomLog "| /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

but this doesn't:

     CustomLog "| /bin/sed | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

How about this:

     CustomLog "| /bin/cat | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

"cat" with no arguments just copies stdin to stdout, so we can tell if sed is the problem, or the piping.

Also, I would think if putting the piped command directly in the log config is the problem, then replacing it with a wrapper script ought to work.  I assume your script looked like:

#!/bin/sh
/bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log

(maybe with one level of backslashes removed), was marked executable, and the full path was configured:

CustomLog "| /path/to/wrapper/script" combined env=survey_log

You might try a simpler script:

#!/bin/sh
/bin/cat >>/path/to/logfile

again just to rule out something funny in the sed/sudo/cronolog part as opposed to Apache.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: mod_log_config issue

Posted by Dan Poirier <po...@pobox.com>.
Joe Hammerman <jh...@videoegg.com> writes:

> 	If we replaced Sed with Cat, I'm a little confused as to what we would be catting; there's a stream coming in, right?
>
> To your second question - yes, logging is fully functional with sudo
>
> To your final question - no, even with a sed command that performs no actions, no logging information is generated.
>
> -----Original Message-----
> From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
> Sent: Wednesday, January 27, 2010 12:03 PM
> To: users@httpd.apache.org
> Subject: [users@httpd] Re: mod_log_config issue
>
>> We have an issue with mod_log_config; specifically we are trying to pipe log output through Sed before it goes to Cronolog. The result is that we get no output whatsoever.
>>
>>     CustomLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log
>>
>>     ErrorLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/error_log"
>>
>> We have also experimented with writing a wrapper script that performs all three of the above functions - the result is the same.
>>
> What's the simplest case that doesn't work?  What if you take out the
> whole 'sed' command and just use /bin/cat?  Does invoking cronolog with
> sudo work when not receiving input piped from another command?  Does it
> work with a simpler sed script?

Okay, then you're saying this gives you logging:

     CustomLog "| /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

but this doesn't:

     CustomLog "| /bin/sed | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

How about this:

     CustomLog "| /bin/cat | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log

"cat" with no arguments just copies stdin to stdout, so we can tell if sed is the problem, or the piping.

Also, I would think if putting the piped command directly in the log config is the problem, then replacing it with a wrapper script ought to work.  I assume your script looked like:

#!/bin/sh
/bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log

(maybe with one level of backslashes removed), was marked executable, and the full path was configured:

CustomLog "| /path/to/wrapper/script" combined env=survey_log

You might try a simpler script:

#!/bin/sh
/bin/cat >>/path/to/logfile

again just to rule out something funny in the sed/sudo/cronolog part as opposed to Apache.


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


RE: [users@httpd] Re: mod_log_config issue

Posted by Joe Hammerman <jh...@videoegg.com>.
Hi Dan,
	If we replaced Sed with Cat, I'm a little confused as to what we would be catting; there's a stream coming in, right?

To your second question - yes, logging is fully functional with sudo

To your final question - no, even with a sed command that performs no actions, no logging information is generated.

-----Original Message-----
From: news [mailto:news@ger.gmane.org] On Behalf Of Dan Poirier
Sent: Wednesday, January 27, 2010 12:03 PM
To: users@httpd.apache.org
Subject: [users@httpd] Re: mod_log_config issue

Joe Hammerman <jh...@videoegg.com> writes:

> Hello Apache users list.
>
> We have an issue with mod_log_config; specifically we are trying to pipe log output through Sed before it goes to Cronolog. The result is that we get no output whatsoever.
>
> Here is a sample of the directives we are using in our VirtualHost container:
>
>     CustomLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/survey_log" combined env=survey_log
>
>     ErrorLog "| /bin/sed s/[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\}\\\.[0-9]\\\{1,3\\\},\\\ //g | /usr/bin/sudo -u VEsvc /usr/sbin/cronolog --period=1hours /mnt/export/www/logs/beacon/%Y%m%d/%H/error_log"
>
> We have also experimented with writing a wrapper script that performs all three of the above functions - the result is the same.
>
> Does anyone have any input? Is what we are attempting possible?

What's the simplest case that doesn't work?  What if you take out the
whole 'sed' command and just use /bin/cat?  Does invoking cronolog with
sudo work when not receiving input piped from another command?  Does it
work with a simpler sed script?


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org