From patchwork Wed Mar 8 14:59:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 6684 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PWwTc3JM3z3wkG for ; Wed, 8 Mar 2023 15:00:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PWwTY5S7tz1rm; Wed, 8 Mar 2023 15:00:01 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PWwTY3Bwrz30J0; Wed, 8 Mar 2023 15:00:01 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384 client-signature ECDSA (P-384) client-digest SHA384) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PWwTW5bcGz30GL for ; Wed, 8 Mar 2023 14:59:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PWwTV1ZCSzKQ; Wed, 8 Mar 2023 14:59:58 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1678287598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9TD4knmnNjI2p0u02lqW1N+3qdU1w8IIoCszx6zGN/4=; b=4mG868LwtbF50sKsqKrp5XOMX0cMXKwO6nVU9NrZHNWQb9ohoN7JNBTFSUycAK9Ci0nlR/ WopLSFAynlxGrPCw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1678287598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=9TD4knmnNjI2p0u02lqW1N+3qdU1w8IIoCszx6zGN/4=; b=VWqgEpb7WOdmD2oZWiE5/Z39giV+qUrPQUqmz2GyONO2kRDSWgKFLZt2kI6VxX+CDbzFL+ 0CiRqUJjlFH8q3RFBQWPdJbDkhoC0AwJbWtiWJbalpaLcIuU2ymTe7nbZTmCQf+llXebRA mLsnRzM/c9U3dkrje4rMtuyMlMZV/5R1M+M4KWSfHtYHQ3xGZt4wbW8FDFOWJPmF9NMQjh YQWahhVfwjRUszb1A55IA5LVMJiUrWmIJ8wr2cygiMeHu7IHj48uvNtXQR2b3G50ynpPJE jwhMM9GahRuz0AYFw/C51hncCQZn8ofn26XC3HgKop7yFB9HJ2vCBMq3lLy4Tw== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 1/2] log.dat: Fix bug#12922 - add HAProxy to System Log drop down list Date: Wed, 8 Mar 2023 15:59:54 +0100 Message-Id: <20230308145955.3567-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Errors-To: development-bounces@lists.ipfire.org Sender: "Development" Fixes: Bug#12922 Suggested-by: Michael Tested-by: Michael Signed-off-by: Adolf Belka --- html/cgi-bin/logs.cgi/log.dat | 2 ++ 1 file changed, 2 insertions(+) diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index fbc83f48d..d3f2599f8 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -60,6 +60,7 @@ my %sections = ( 'dhcp' => '(dhcpd: )', 'dma' => '(dma: |dma\[.*\]: |postfix/\w*\[\d*\]: )', 'guardian' => '(guardian\[.*\]: )', + 'haproxy' => '(haproxy\[.*?\]: )', 'ipblocklist' => '(ipblocklist: )', 'ipfire' => '(ipfire: )', 'ipsec' => '(ipsec_[\w_]+: |pluto\[.*\]: |charon: |vpnwatch: )', @@ -93,6 +94,7 @@ my %trsections = ( 'dhcp' => "$Lang::tr{'dhcp server'}", 'dma' => 'Mail', 'guardian' => "$Lang::tr{'guardian'}", + 'haproxy' => 'HAProxy', 'ipblocklist' => "$Lang::tr{'ipblocklist'}", 'ipfire' => 'IPFire', 'ipsec' => 'IPSec', From patchwork Wed Mar 8 14:59:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adolf Belka X-Patchwork-Id: 6685 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4PWwTc6R8Yz3x6w for ; Wed, 8 Mar 2023 15:00:04 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4PWwTZ1qLDz2Lw; Wed, 8 Mar 2023 15:00:02 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4PWwTY404Sz30JM; Wed, 8 Mar 2023 15:00:01 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4PWwTW5nYCz30HB for ; Wed, 8 Mar 2023 14:59:59 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by mail01.ipfire.org (Postfix) with ESMTPSA id 4PWwTW3pWfzcp; Wed, 8 Mar 2023 14:59:59 +0000 (UTC) DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003ed25519; t=1678287599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6hkSS6BibCoyG4GntpH9Tbe31zJrxOQ6tkWc6z32YI8=; b=1r2VDVfuFe9jU8QCHgE/iZ7zjMmlhjPZ2VXjJpB+/xgjMHm3JQblpYy/eBwzBfoMLpgOY5 C0ACaKEbwiKt9TBg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ipfire.org; s=202003rsa; t=1678287599; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6hkSS6BibCoyG4GntpH9Tbe31zJrxOQ6tkWc6z32YI8=; b=Lxw8+yE/78GRR+G+8GTIIZ9UQ4uO+GU5XPKGLubMVhrwYw0EEvjpMSur82D9O1j4tennMR tf+cJEcr6HAdi7ntZjsbizKEc8UJS07Nb+hyc+sWyKCEKV67NWNT08OxfwJoc6jPmBKaQW 2W6TvBZG5q3xG5LNchbMT224dua3J+PgTo/ZQNLrih1VK74XEuktVcK24yItCdxS83h+Hy mKZX7O9R2PvrcZm0iAviKjS7kvnYqRYKv1ygB9jho9+XSeQyDbraaPfvn6LOmAyzIJzTaf yX1InussyXnjPKadI+itymnPkVV6R9UjNZM296/S6DUgl/zS4flIrl/ED3gCOA== From: Adolf Belka To: development@lists.ipfire.org Subject: [PATCH 2/2] log.dat: Fixes Bug#12922 - adjusts regex to catch hostname for hostname or FQDN Date: Wed, 8 Mar 2023 15:59:55 +0100 Message-Id: <20230308145955.3567-2-adolf.belka@ipfire.org> In-Reply-To: <20230308145955.3567-1-adolf.belka@ipfire.org> References: <20230308145955.3567-1-adolf.belka@ipfire.org> MIME-Version: 1.0 X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Michael Errors-To: development-bounces@lists.ipfire.org Sender: "Development" - Most of the packages being searched for in the system logs section only put hostname into the logs. However HAProxy puts the FQDN. Reviewing RFC 5424 shows that this is following the requirements. The preferred order fromn the RFC is 1. FQDN 2. Static IP address 3. hostname 4. Dynamic IP address 5. the NILVALUE - Most of the programs are using option 3 but option 1 is valid for HAProxy - The regex change filters out the hostname from the FQDN if an extra 'dot' is present Fixes: Bug#12922 Suggested-by: Michael Tested-by: Michael Signed-off-by: Adolf Belka --- html/cgi-bin/logs.cgi/log.dat | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/html/cgi-bin/logs.cgi/log.dat b/html/cgi-bin/logs.cgi/log.dat index d3f2599f8..53b9073fc 100644 --- a/html/cgi-bin/logs.cgi/log.dat +++ b/html/cgi-bin/logs.cgi/log.dat @@ -231,7 +231,7 @@ while ($gzindex >=0 && $loop) { #&General::log("reading $filestr"); READ:while () { my $line = $_; - if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-]+ ${section}(.*)/) { + if ($line =~ /^${monthstr} ${daystr} ..:..:.. [\w\-\.]+ ${section}(.*)/) { # when standard viewing, just keep in memory the correct slice # it starts a '$start' and size is $viewport # If export, then keep all lines... @@ -276,7 +276,7 @@ if ($cgiparams{'ACTION'} eq $Lang::tr{'export'}) foreach $_ (@log) { - /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/; + /^... (..) (..:..:..) [\w\-\.]+ ${section}(.*)$/; my $day = $1; $day =~ tr / /0/; my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ; @@ -399,7 +399,7 @@ $lines = 0; #print ''; foreach $_ (@log) { - /^... (..) (..:..:..) [\w\-]+ ${section}(.*)$/; + /^... (..) (..:..:..) [\w\-\.]+ ${section}(.*)$/; my $day = $1; $day =~ tr / /0/; my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;