X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=tools%2Fprivoxy-log-parser.pl;h=b43dfe1bc04abca1b7ef9dffe3dd4718907f55d7;hp=bc1ab04b0cfee1217a56d02531b833e6390a7711;hb=4bd83c31c0f7b8c464b5dbdb9bb69640bba295ae;hpb=e42058e7c7ed0df990f2056ce40caee05159a76c diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl index bc1ab04b..b43dfe1b 100755 --- a/tools/privoxy-log-parser.pl +++ b/tools/privoxy-log-parser.pl @@ -1210,6 +1210,12 @@ sub handle_loglevel_re_filter($) { return '' unless SHOW_FILTER_READIN_IN; + } elsif ($c =~ m/^Decompression didn't result/) { + + # Decompression didn't result in any content. + + # Nothing to highlight. + } else { found_unknown_content($content); @@ -1764,6 +1770,12 @@ sub handle_loglevel_connect($) { # Waiting for the next client connection. Currently active threads: 30 $c =~ s@(?<=threads: )(\d+)@$h{'Number'}$1$h{'Standard'}@; + } elsif ($c =~ m/^Data arrived in time on client socket/) { + + # Data arrived in time on client socket 6. Requests so far: 3 + $c =~ s@(?<=client socket )(\d+)@$h{'Number'}$1$h{'Standard'}@; + $c =~ s@(?<=Requests so far: )(\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 @@ -2017,14 +2029,19 @@ sub gather_loglevel_clf_stats($) { our %cli_options; # +0200] "GET https://www.youtube.com/watch?v=JmcA9LIIXWw HTTP/1.1" 200 68004 - $content =~ m/^[+-]\d{4}\] "(\w+) (.+) (HTTP\/\d\.\d)" (\d+) (\d+)/; + # +0200] "VERSION-CONTROL http://p.p/ HTTP/1.1" 200 2787 + $content =~ m/^[+-]\d{4}\] "([^ ]+) (.+) (HTTP\/\d\.\d)" (\d+) (\d+)/; $method = $1; $resource = $2; $http_version = $3; $status_code = $4; $size = $5; + $stats{requests_clf}++; + unless (defined $method) { + # +0200] "Invalid request" 400 0 + return if ($content =~ m/^[+-]\d{4}\] "Invalid request"/); print("Failed to parse: $content\n"); return; } @@ -2035,12 +2052,11 @@ sub gather_loglevel_clf_stats($) { $stats{'http-version'}{$http_version}++; if ($cli_options{'host-statistics-threshold'} != 0) { - $resource =~ m@(?:http[s]://)([^/]+)/?@; + $resource =~ m@(?:https?://)?([^/]+)/?@; $stats{'hosts'}{$1}++; } $stats{'content-size-total'} += $size; $stats{'status-code'}{$status_code}++; - $stats{requests_clf}++; } sub gather_loglevel_request_stats($$) {