Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 97170 invoked from network); 28 Jan 2010 15:10:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 28 Jan 2010 15:10:52 -0000 Received: (qmail 16332 invoked by uid 500); 28 Jan 2010 15:10:49 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 16295 invoked by uid 500); 28 Jan 2010 15:10:49 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 16286 invoked by uid 99); 28 Jan 2010 15:10:49 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 15:10:49 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of apache-users@m.gmane.org designates 80.91.229.12 as permitted sender) Received: from [80.91.229.12] (HELO lo.gmane.org) (80.91.229.12) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 28 Jan 2010 15:10:39 +0000 Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1NaW0X-00077Y-8E for users@httpd.apache.org; Thu, 28 Jan 2010 16:10:09 +0100 Received: from bi01p1.nc.us.ibm.com ([129.33.49.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jan 2010 16:10:09 +0100 Received: from poirier by bi01p1.nc.us.ibm.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Thu, 28 Jan 2010 16:10:09 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: users@httpd.apache.org From: Dan Poirier Date: Thu, 28 Jan 2010 10:09:34 -0500 Lines: 56 Message-ID: References: <1264612181.82048.ezmlm@httpd.apache.org> <5045A4D718CAB644BA24979206486B6006328C44@hptimail03.HPTI.COM> <8D40C83B54E3CE43BD7F88EA8FFC137F0DD4F928@exchange101> <8D40C83B54E3CE43BD7F88EA8FFC137F0DD4FA2A@exchange101> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: bi01p1.nc.us.ibm.com User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (darwin) Cancel-Lock: sha1:uFthUz1N/mCUxDDVAfigGcwHvm0= Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Subject: [users@httpd] Re: mod_log_config issue Joe Hammerman 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 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