From: Darold Gilles Date: Thu, 17 Jan 2013 20:42:59 +0000 (+0100) Subject: Fix major bug on syslog parser where years part of the date was wrongly extracted... X-Git-Tag: v3.2~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=31ba5ebb54da39f3fcf21a717a1fbad7bbdd3c03;p=pgbadger Fix major bug on syslog parser where years part of the date was wrongly extracted from current date with logs generated in 2012. --- diff --git a/pgbadger b/pgbadger index b007a51..7816271 100755 --- a/pgbadger +++ b/pgbadger @@ -718,9 +718,8 @@ foreach my $logfile ( @given_log_files ) { $prefix_vars{'t_day'} = sprintf("%02d", $prefix_vars{'t_day'}); $prefix_vars{'t_month'} = $month_abbr{$prefix_vars{'t_month'}}; if ("$prefix_vars{'t_year'}$prefix_vars{'t_month'}$prefix_vars{'t_day'}" > $CURRENT_DATE) { - $prefix_vars{'t_year'} = substr($CURRENT_DATE, 1, 4) - 1; + $prefix_vars{'t_year'} = substr($CURRENT_DATE, 0, 4) - 1; } - $prefix_vars{'t_date'} = $prefix_vars{'t_year'} . $prefix_vars{'t_month'} @@ -2089,11 +2088,23 @@ sub dump_as_html print $fh qq{
  • Number of events: $fmt_errors
  • Number of unique normalized events: $fmt_unique_error
  • +}; + } + if ($autovacuum_info{count}) { + print $fh qq{ +
  • Total number of automatic vacuums: $autovacuum_info{count}
  • +}; + } + if ($autoanalyze_info{count}) { + print $fh qq{ +
  • Total number of automatic analyzes: $autoanalyze_info{count}
  • +}; + } + print $fh qq{