From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 3 Jun 2020 09:12:56 +0000 (+0200)
Subject: privoxy-log-parser.pl: Completely highlight: 'Connection from 192.168.2.1 on 127... 
X-Git-Tag: v_3_0_29~328
X-Git-Url: http://www.privoxy.org/gitweb/%22https:/faq/@default-cgi@/diff?a=commitdiff_plain;h=54871a1a07f84001abb545bcb5bd06339fff7407;p=privoxy.git

privoxy-log-parser.pl: Completely highlight: 'Connection from 192.168.2.1 on 127.0.1.1:8118 (socket 3) dropped due to ACL'

Change the highlight type of the first IP address to "host"
instead of "Number".
---

diff --git a/tools/privoxy-log-parser.pl b/tools/privoxy-log-parser.pl
index 12febaad..92288cca 100755
--- a/tools/privoxy-log-parser.pl
+++ b/tools/privoxy-log-parser.pl
@@ -1610,7 +1610,10 @@ sub handle_loglevel_connect($) {
 
         # Connection from 81.163.28.218 dropped due to ACL
         # Rejecting connection from 178.63.152.227. Maximum number of connections reached.
-        $c =~ s@(?<=onnection from )((?:\d+\.?){3}\d+)@$h{'Number'}$1$h{'Standard'}@;
+        # Connection from 192.168.2.1 on 127.0.1.1:8118 (socket 3) dropped due to ACL
+        $c = highlight_matched_host($c, '(?<=onnection from )[\d.:]+');
+        $c = highlight_matched_host($c, '(?<=on )[\d.:]+');
+        $c =~ s@(?<=socket )(\d+)@$h{'Number'}$1$h{'Standard'}@;
 
     } elsif ($c =~ m/^(?:Reusing|Closing) server socket / or
              $c =~ m/^No additional client request/) {