filter with pipe, bogus message
Allan Wind
allanwind at lifeintegrity.com
Tue Feb 11 05:20:38 CET 2003
On 2003-02-10 02:23:11, wrote:
> Can you suggest a work-around so I can get the effect of the above
> filter without having to hack lr_run?
FWIW, I wrote a converter for boa's virtual access log format (removed
the interface before passing the line to combined2dlf). Then added
"boa_virtual_access www" to address.cf and things are flying.
/Allan
--
Allan Wind
P.O. Box 2022
Woburn, MA 01888-0022
USA
-------------- next part --------------
#! /usr/bin/perl -w
# vim:syntax=perl
use strict;
use lib '/usr/share/perl5';
use Lire::DlfSchema;
use Lire::Program qw( :msg :dlf );
use Lire::Apache qw( combined2dlf );
my $lines = 0;
my $dlflines = 0;
my $errorlines = 0;
init_dlf_converter( "www" );
while (<>) {
chomp;
# remove ip of interface
s/^[^ ]+ //;
$lines++;
eval {
my $dlf = combined2dlf( $_ );
print join( " ", @$dlf), "\n";
$dlflines++;
};
if ($@) {
lr_warn( $@ );
lr_notice( qq{cannot convert line $. "$_" to www dlf, skipping} );
$errorlines++;
}
}
end_dlf_converter( $lines, $dlflines, $errorlines );
__END__
=pod
=head1 NAME
combined2dlf - convert combined log file to DLF
=head1 SYNOPSIS
B<combined2dlf> I<file>
=head1 DESCRIPTION
B<combined2dlf> converts web server log files in the combined log format
to the www DLF. The combined (also known as extended common log
format) log format was first implemented in the NSCA httpd webs server
but is now supported in many web servers. Apache can be configured to
use that log format.
=head1 COMBINED LOG FORMAT
The combined log format is an extension to the Common Log Format (see
L<common2dlf(1)>). It adds two fields to the end of the line :
"I<referer>" "I<useragent>"
=over 4
=item I<referer>
The content of the Referer request's header. This usually
reflects the page where the user was before that request.
=item I<useragent>
The content of the User-Agent request's header. This usually reflects
the browser that the user is using.
=back
Log example :
127.0.01 - - [11/03/2001 12:12:01 -0400] "GET / HTTP/1.0" 200 513 "-" "Mozilla/5.0"
dsl1.myprovider.com - francis [11/03/2001 12:14:01 -0400] "GET /secret/ HTTP/1.0" 200 1256 "http://www.example.com/index.html" "Mozilla/5.0"
=head1 SEE ALSO
common2dlf(1), modgzip2dlf(1), referer2dlf(1)
=head1 AUTHORS
Joost van Baal <joostvb at logreport.org>, Francis J. Lacoste
<flacoste at logreport.org> and Egon Willighagen <egonw at logreport.org>,
based on an idea by Edwin Groothuis
=head1 VERSION
$Id: combined2dlf.in,v 1.5 2002/06/21 11:57:34 vanbaal Exp $
=head1 COPYRIGHT
Copyright (C) 2000-2001 Stichting LogReport Foundation LogReport at LogReport.org
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program (see COPYING); if not, check with
http://www.gnu.org/copyleft/gpl.html or write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
=cut
# Local Variables:
# mode: cperl
# End:
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.logreport.org/pipermail/questions/attachments/20030210/c4b87805/attachment.bin
More information about the Questions
mailing list