X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=tools%2Fprivoxy-log-parser.pl;h=f6ee2f4121d00b6d65670a239eb72b40cbab8348;hb=e89f2e2cabf8f63bb16ae38acd9b345945de34a5;hp=193b8a65a17e2ba76c7ec3ca3580b35d6fd2936f;hpb=0272f53c685d9fc3585b1764347fca002505c949;p=privoxy.git diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index 193b8a65..f6ee2f41 100755 --- a/tools/privoxy-log-parser.pl +++ b/tools/privoxy-log-parser.pl @@ -43,7 +43,7 @@ use warnings; use Getopt::Long; use constant { - PRIVOXY_LOG_PARSER_VERSION => '0.9.3', + PRIVOXY_LOG_PARSER_VERSION => '0.9.4', # Feel free to mess with these ... DEFAULT_BACKGROUND => 'black', # Choose registered colour (like 'black') DEFAULT_TEXT_COLOUR => 'white', # Choose registered colour (like 'black') @@ -1890,6 +1890,16 @@ sub handle_loglevel_connect($) { # Complete client request followed by 59 bytes of pipelined data received. $c =~ s@(?<=followed by )(\d+)@$h{'Number'}$1$h{'Standard'}@; + } elsif ($c =~ m/^The peer notified us that the connection on socket/) { + + # The peer notified us that the connection on socket 11 is going to be closed + $c =~ s@(?<=socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + + } elsif ($c =~ m/^Client socket \d is no longer usable/) { + + # Client socket 7 is no longer usable. The server socket has been closed. + $c =~ s@(?<=socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + } elsif ($c =~ m/^Looks like we / or $c =~ m/^Unsetting keep-alive flag/ or $c =~ m/^No connections to wait/ or @@ -2405,7 +2415,7 @@ sub print_stats() { ")\n"; print "Client connections: " . $stats{'closed-client-connections'} . "\n"; if ($stats{'content-size-total'}) { - print "Bytes of content transfered to the client: " . $stats{'content-size-total'} . "\n"; + print "Bytes of content transferred to the client: " . $stats{'content-size-total'} . "\n"; } my $lines_printed = 0; print "Client requests per connection distribution:\n"; @@ -2444,7 +2454,7 @@ sub print_stats() { print "HTTP version distribution unknown. No CLF message parsed yet. Is 'debug 512' enabled?\n"; } if (exists $stats{'status-code'}) { - print "HTTP status codes:\n"; + print "HTTP status codes according to 'debug 512' (status codes sent by the server may differ):\n"; foreach my $status_code (sort {$stats{'status-code'}{$b} <=> $stats{'status-code'}{$a}} keys %{$stats{'status-code'}}) { printf "%8d : %-8d\n", $stats{'status-code'}{$status_code}, $status_code; } @@ -2650,7 +2660,7 @@ sub parse_loop() { sub stats_loop() { - my ($day, $time_stamp, $msecs, $thread, $log_level, $content); + my ($day, $time_stamp, $thread, $log_level, $content); my $strict_checks = cli_option_is_set('strict-checks'); my %log_level_handlers = ( 'Connect:' => \&gather_loglevel_connect_stats, @@ -2813,18 +2823,16 @@ sub main() { set_background(DEFAULT_BACKGROUND); prepare_our_stuff(); - print_intro(); - # XXX: should explicitly reject incompatible argument combinations if (cli_option_is_set('unbreak-lines-only')) { unbreak_lines_only_loop(); } elsif (cli_option_is_set('statistics')) { stats_loop(); } else { + print_intro(); parse_loop(); + print_outro(); } - - print_outro(); } main(); @@ -2866,7 +2874,7 @@ will hide the "filter foo caused 0 hits" message. if it's above or equal to the given threshold. If the threshold is 0, host statistics are disabled. -[B<--html-output>] Use HTML and CSS for the syntax highlighting. If this option is +[B<--html-output>] Use HTML and CSS when syntax highlighting. If this option is omitted, ANSI escape sequences are used unless B<--no-syntax-highlighting> is active. This option is only intended to make embedding log excerpts in web pages easier. It does not escape any input!