Logwatch: euro date format

Guillaume LEBAS <[email protected]> Wed, 5 Aug 2020 07:34:36 +0000
Newsgroups gmane.comp.log.logwatch.devel
Message-ID <PR3PR02MB5994F8BB0D78086A17AA4976F04B0@PR3PR02MB5994.eurprd02.prod.outlook.com>
--===============5400614811855147312==
Content-Language: fr-FR
Content-Type: multipart/alternative;
	boundary="_000_PR3PR02MB5994F8BB0D78086A17AA4976F04B0PR3PR02MB5994eurp_"

--_000_PR3PR02MB5994F8BB0D78086A17AA4976F04B0PR3PR02MB5994eurp_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hello,

Logwatch (v7.5.4 and below) uses a trailing space in "ApplyStdDate" and "Ap=
plyEuroDate" (adapted from the former) formats. I struggled to figure out w=
hy it outputs nothing from Let's Encrypt logs, eg. "2020-08-02 21:12:16,231=
:DEBUG:certbot[...]".

I suggest the following changes:

diff --git a/logwatch-7.5.4/scripts/shared/applyeurodate b/logwatch-dev/scr=
ipts/shared/applyeurodate
index 111c540..8c72ec3 100644
--- a/logwatch-7.5.4/scripts/shared/applyeurodate
+++ b/logwatch-dev/scripts/shared/applyeurodate
@@ -30,7 +30,7 @@ use Logwatch ':dates';

 my $Debug =3D $ENV{'LOGWATCH_DEBUG'} || 0;

-$SearchDate =3D TimeFilter($ARGV[0] || '%Y-%m-%d %H:%M:%S(,...)? ');
+$SearchDate =3D TimeFilter($ARGV[0] || '%Y-%m-%d %H:%M:%S(,...)?');

 if ( $Debug > 5 ) {
    print STDERR "DEBUG: Inside ApplyEuroDate...\n";
diff --git a/logwatch-7.5.4/scripts/shared/applystddate b/logwatch-dev/scri=
pts/shared/applystddate
index cc0bd06..e8f8439 100644
--- a/logwatch-7.5.4/scripts/shared/applystddate
+++ b/logwatch-dev/scripts/shared/applystddate
@@ -24,8 +24,8 @@ my $Debug =3D $ENV{'LOGWATCH_DEBUG'} || 0;

 # customize the Timefilter by appending a string:
 # *ApplyStdDate =3D "%H:%M %d/%m/%Y"
-$SearchDate =3D TimeFilter($ARGV[0] || '%b %e %H:%M:%S ');
-$SearchDateRsyslog =3D TimeFilter('%Y-%m-%dT%H:%M:%S(:?\.[0-9]+)?(:?[+-][0=
-9]{2}:[0-9]{2}|Z) ');
+$SearchDate =3D TimeFilter($ARGV[0] || '%b %e %H:%M:%S');
+$SearchDateRsyslog =3D TimeFilter('%Y-%m-%dT%H:%M:%S(:?\.[0-9]+)?(:?[+-][0=
-9]{2}:[0-9]{2}|Z)');

 # The date might be "Dec 09", but it needs to be "Dec  9"...
 #$SearchDate =3D~ s/ 0/  /;


Best regards.

--_000_PR3PR02MB5994F8BB0D78086A17AA4976F04B0PR3PR02MB5994eurp_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Diso-8859-=
1">
<style type=3D"text/css" style=3D"display:none;"> P {margin-top:0;margin-bo=
ttom:0;} </style>
</head>
<body dir=3D"ltr">
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
Hello,</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<br>
</div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
Logwatch (v7.5.4 and below) uses a trailing space in<span style=3D"font-fam=
ily: Calibri, Helvetica, sans-serif; background-color: rgb(255, 255, 255); =
display: inline !important">&nbsp;&quot;ApplyStdDate&quot; and</span>&nbsp;=
&quot;ApplyEuroDate&quot; (adapted from the former) formats.&nbsp;<span sty=
le=3D"font-family: Calibri, Helvetica, sans-serif; background-color: rgb(25=
5, 255, 255); display: inline !important">I
 struggled to figure out why it outputs nothing from Let's Encrypt logs, eg=
. &quot;2020-08-02 21:12:16,231:DEBUG:certbot[...]&quot;.</span></div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important">I suggest the following =
changes:</span></div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important"><br>
</span></div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important"></span></div>
<span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt=
; color: rgb(0, 0, 0);">diff --git a/logwatch-7.5.4/scripts/shared/applyeur=
odate b/logwatch-dev/scripts/shared/applyeurodate</span>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">index 111c540..8c72ec3 100644</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">--- a/logwatch-7.5.4/scripts/shared/applyeurod=
ate</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">+++ b/logwatch-dev/scripts/shared/applyeurodat=
e</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">@@ -30,7 +30,7 @@ use Logwatch ':dates';</span=
></div>
<div><br>
</div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;my $Debug =3D $ENV{'LOGWATCH_DEBUG'} || =
0;</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">-$SearchDate =3D TimeFilter($ARGV[0] || '%Y-%m=
-%d %H:%M:%S(,...)? ');</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">+$SearchDate =3D TimeFilter($ARGV[0] || '%Y-%m=
-%d %H:%M:%S(,...)?');</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;if ( $Debug &gt; 5 ) {</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp; &nbsp; print STDERR &quot;DEBUG: Inside=
 ApplyEuroDate...\n&quot;;</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">diff --git a/logwatch-7.5.4/scripts/shared/app=
lystddate b/logwatch-dev/scripts/shared/applystddate</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">index cc0bd06..e8f8439 100644</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">--- a/logwatch-7.5.4/scripts/shared/applystdda=
te</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">+++ b/logwatch-dev/scripts/shared/applystddate=
</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">@@ -24,8 +24,8 @@ my $Debug =3D $ENV{'LOGWATCH=
_DEBUG'} || 0;</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;# customize the Timefilter by appending =
a string:</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;# *ApplyStdDate =3D &quot;%H:%M %d/%m/%Y=
&quot;</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">-$SearchDate =3D TimeFilter($ARGV[0] || '%b %e=
 %H:%M:%S ');</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">-$SearchDateRsyslog =3D TimeFilter('%Y-%m-%dT%=
H:%M:%S(:?\.[0-9]+)?(:?[+-][0-9]{2}:[0-9]{2}|Z) ');</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">+$SearchDate =3D TimeFilter($ARGV[0] || '%b %e=
 %H:%M:%S');</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">+$SearchDateRsyslog =3D TimeFilter('%Y-%m-%dT%=
H:%M:%S(:?\.[0-9]+)?(:?[+-][0-9]{2}:[0-9]{2}|Z)');</span></div>
<div><br>
</div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;# The date might be &quot;Dec 09&quot;, =
but it needs to be &quot;Dec &nbsp;9&quot;...</span></div>
<div><span style=3D"font-family: Calibri, Helvetica, sans-serif; font-size:=
 12pt; color: rgb(0, 0, 0);">&nbsp;#$SearchDate =3D~ s/ 0/ &nbsp;/;</span><=
/div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important"><br class=3D"Apple-inter=
change-newline">
<br>
</span></div>
<div style=3D"font-family: Calibri, Helvetica, sans-serif; font-size: 12pt;=
 color: rgb(0, 0, 0);">
<span style=3D"font-family: Calibri, Helvetica, sans-serif; background-colo=
r: rgb(255, 255, 255); display: inline !important">Best regards.</span></di=
v>
</body>
</html>

--_000_PR3PR02MB5994F8BB0D78086A17AA4976F04B0PR3PR02MB5994eurp_--


--===============5400614811855147312==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============5400614811855147312==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Logwatch-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/logwatch-devel

--===============5400614811855147312==--