Fixes: Bug#12922 Suggested-by: Michael ip.fire@die-fritzens.de Tested-by: Michael ip.fire@die-fritzens.de Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- 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',
- 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 ip.fire@die-fritzens.de Tested-by: Michael ip.fire@die-fritzens.de Signed-off-by: Adolf Belka adolf.belka@ipfire.org --- 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 (<FILE>) { 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 '<tt>'; foreach $_ (@log) { - /^... (..) (..:..:..) [\w-]+ ${section}(.*)$/; + /^... (..) (..:..:..) [\w-.]+ ${section}(.*)$/; my $day = $1; $day =~ tr / /0/; my $time = $cgiparams{'DAY'} ? "$2" : "$day/$2" ;