httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "S.A. Birl" <>
Subject [users@httpd] creating own program for piped logs
Date Mon, 28 Apr 2008 19:42:11 GMT
Hello all!

(Please let know if Im re-inventing the wheel here ...)

Im the beginning stages of a PERL script to parse incoming requests by
the first directory name (for tracking individual website stats).

(ie: - - [28/Apr/2008:15:31:36 -0400] "GET /stats/blah/blah HTTP/1.0" 200 13127
     would log to a file called "stats" while - - [28/Apr/2008:15:31:36 -0400] "GET /photo/blah/blah HTTP/1.0" 200 15093
     would log to a file called "photo"

In the virtual host I have the pipe set up:
    CustomLog "|/usr/local/apache/bin/" common

The PERL program executes without failure from the commandline (and
writes my input followed by ^D), but does not write anything when
invoked (as root) from the pipe.

Not looking for PERL help per se, but more for help on why the pipe is
failing.  Script is chmod 0700   root:root.

Apache is error logging with debug, but there's nothing to related the
PERL program in there.

 S.A. Birl

#!/usr/bin/perl -T
# c: 2008-Apr-28  S.A. Birl
# m:
# For every incoming request to Apache, this program will analyze the
# line and log it to the appropriate file for later parsing.
# This program assumes the STDIN is standard Apache "common" logging.

use strict;
use warnings;

my $DIRECTORY="/usr/local/apache/logs/websites"; 	# Where we will log
my $Website;						# Extracted from the input
my $DebugLog="$DIRECTORY/___DebugLog___"; 		# debugging purposes
my $WebsiteLog;						# $DIRECTORY/$Website

open(DEBUG, ">>$DebugLog") or die;

#print "#";
print DEBUG <>;


Please do not CC me responses to my own posts.
I'll read the responses on the list.


The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:> for more info.
To unsubscribe, e-mail:
   "   from the digest:
For additional commands, e-mail:

View raw message