#
# http://www.fabiankeil.de/sourcecode/privoxy-log-parser/
#
-# $Id: privoxy-log-parser.pl,v 1.124 2008/11/22 10:02:52 fk Exp $
+# $Id: privoxy-log-parser.pl,v 1.127 2008/12/06 11:29:58 fk Exp $
#
# TODO:
# - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting
$c =~ s@(?<=Actual content length: )(\d+)@$h{'Number'}$1$h{'Standard'}@;
$c =~ s@(?<=received: )(\d+)@$h{'Number'}$1$h{'Standard'}@;
- } elsif ($c =~ m/^Looks like we reached/ or
+ } elsif ($c =~ m/^Continuing buffering headers/) {
+
+ # Continuing buffering headers. byte_count: 19. header_offset: 517. len: 536.
+ $c =~ s@(?<=byte_count: )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+ $c =~ s@(?<=header_offset: )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+ $c =~ s@(?<=len: )(\d+)@$h{'Number'}$1$h{'Standard'}@;
+
+ } elsif ($c =~ m/^Looks like we rea/ or
$c =~ m/^Unsetting keep-alive flag/) {
# Looks like we reached the end of the last chunk. We better stop reading.
+ # Looks like we read the end of the last chunk together with the server \
+ # headers. We better stop reading.
# Unsetting keep-alive flag.
} else {
$output = '';
- if (m/^(\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\(([^\)]*)\)) ([\w -]*): (.*)$/) {
+ if (m/^(\w{3} \d{2}) (\d\d:\d\d:\d\d)\.?(\d+)? (?:Privoxy\()?([^\)\s]*)[\)]? ([\w -]*): (.*)$/) {
# XXX: Put in req hash?
$day = $1;
$time_stamp = $2;