#
# http://www.fabiankeil.de/sourcecode/privoxy-log-parser/
#
-# $Id: privoxy-log-parser.pl,v 1.133 2012/07/27 17:37:00 fabiankeil Exp $
+# $Id: privoxy-log-parser.pl,v 1.137 2012/09/04 08:39:30 fabiankeil Exp $
#
# TODO:
# - LOG_LEVEL_CGI, LOG_LEVEL_ERROR, LOG_LEVEL_WRITE content highlighting
SHOW_FILTER_READIN_IN => 0,
SUPPRESS_EMPTY_LINES => 1,
SUPPRESS_SUCCESSFUL_CONNECTIONS => 1,
- SUPPRESS_ACCEPTED_CONNECTIONS => 1,
SUPPRESS_GIF_NOT_CHANGED => 1,
SUPPRESS_NEED_TO_DE_CHUNK_FIRST => 1,
Force => 'red',
Writing => 'light_green',
Received => 'yellow',
+ Actions => 'yellow',
# ----------------------
URL => 'yellow',
path => 'brown',
$c = highlight_matched_host($c, '(?<=to )[^\s]+');
- } elsif ($c =~ m/^accepted connection from .*/ or
+ } elsif ($c =~ m/^[Aa]ccepted connection from .*/ or
$c =~ m/^OK/) {
- # accepted connection from 10.0.0.1
+ # Privoxy 3.0.20:
+ # Accepted connection from 10.0.0.1 on socket 5
+ # Privoxy between 3.0.20 and 3.0.6:
+ # accepted connection from 10.0.0.1( on socket 5)?
# Privoxy 3.0.6 and earlier just say:
# OK
- return '' if SUPPRESS_ACCEPTED_CONNECTIONS;
- $c = highlight_matched_host($c, '(?<=connection from ).*');
+ $c = highlight_matched_host($c, '(?<=connection from )[^ ]*');
+ $c = highlight_matched_pattern($c, 'Number', '(?<=socket )\d+');
+
+ } elsif ($c =~ m/^Closing client socket/) {
+
+ # Closing client socket 5. Keep-alive: 0, Socket alive: 1. Data available: 0.
+ $c = highlight_matched_pattern($c, 'Number', '(?<=socket )\d+');
+ $c = highlight_matched_pattern($c, 'Number', '(?<=Keep-alive: )\d+');
+ $c = highlight_matched_pattern($c, 'Number', '(?<=Socket alive: )\d+');
+ $c = highlight_matched_pattern($c, 'Number', '(?<=available: )\d+');
} elsif ($c =~ m/^write header to: .* failed:/) {
'Fatal error' => \&handle_loglevel_ignore,
'Writing' => \&handle_loglevel_ignore,
'Received' => \&handle_loglevel_ignore,
+ 'Actions' => \&handle_loglevel_ignore,
'Unknown log level' => \&handle_loglevel_ignore,
);
'Fatal error' => \&handle_loglevel_ignore,
'Writing' => \&handle_loglevel_ignore,
'Received' => \&handle_loglevel_ignore,
+ 'Actions' => \&handle_loglevel_ignore,
'Unknown log level' => \&handle_loglevel_ignore
);