Apache 1.2.0: TransferLog pipe -- still having problems

Apache 1.2.0: TransferLog pipe -- still having problems

Post by Arpad Gell » Thu, 12 Jun 1997 04:00:00



I'm trying to apply the following directive (in httpd.conf):
(using Apache 1.2.0)

TransferLog "| /usr/local/httpd/cgi-bin/script.cgi"

With the following (script.cgi):

#! /usr/local/bin/perl
open (FILE, ">>/usr/local/etc/httpd/logs/perl_log");
while (<>) {
        print FILE;

Quote:}

close (FILE);
exit 0;

The problem is that the file NEVER writes regardless of whether I shutdown  
or restart the server. The file does get created but it always stays  
empty.

Any ideas?

David Geller

 
 
 

Apache 1.2.0: TransferLog pipe -- still having problems

Post by Chuck Murck » Sat, 14 Jun 1997 04:00:00



> I'm trying to apply the following directive (in httpd.conf):
> (using Apache 1.2.0)

> TransferLog "| /usr/local/httpd/cgi-bin/script.cgi"

> With the following (script.cgi):

> #! /usr/local/bin/perl
> open (FILE, ">>/usr/local/etc/httpd/logs/perl_log");
> while (<>) {
>         print FILE;
> }
> close (FILE);
> exit 0;

> The problem is that the file NEVER writes regardless of whether I shutdown
> or restart the server. The file does get created but it always stays
> empty.

> Any ideas?

> David Geller


You may want to turn off buffering in this script.

$|=1;

--
chuck
Chuck Murcko
The Topsail Group, West Chester PA USA


 
 
 

1. feeding Apache TransferLog into pipe

Hi,

Does anyone have a working example of a configuration using the
'TransferLog |command' type of construct under apache. I'd like to
filter my access logs to exclude certain hosts by feeding each log
entry through a perl script.

I've tried the tags below but both return the error
'Syntax error on line 149 of /data/www/conf/httpd.conf:
TransferLog takes one argument, the filename of the access log'

TransferLog |"/data/www/bin/filter.pl -f
/data/www/conf/planet-filter.conf"
TransferLog |/data/www/bin/filter.pl -f
/data/www/conf/planet-filter.conf

I'm running Apache/1.3b7 (Unix) under Irix 5.3.

The input processing loop in my perl script looks like this but it
looks like the error in occuring during parsing of the apache config
file.

open (OUTPUT, ">>$outputfile") || die "can not open output file";
while (<>) {
  my($host, $remainder) = split /\s+/, $_, 2;
  unless (exists $exclusions{$host}) {
    print OUTPUT;
  }

TIA
Ian

--
Ian S Massingham                        Planet Online SysAdmin Team
Direct Line : +44 (0)113 207 6137         Fax : +44 (0) 113 2345656

2. Mouse pointer appears as large square

3. Apache TransferLog with Apache::LogFile and rotatelogs catastrophy!

4. Software for house alarm-system....

5. TransferLog pipe

6. How is double interpreted

7. Problems with Start Apache 1.2.0 ==> Invalid command TransferLog

8. looking for a good newsreader for X

9. Apache 0.8.11 VirtualHost TransferLog problem

10. TransferLog pipe

11. Having problems implementing IPC with pipes

12. Apache, httpd.conf, transferLog: Limiting certain files from being logged

13. Apache : how do I get the Cookie in the TransferLog?