From: Darold Gilles Date: Mon, 6 Feb 2017 13:28:25 +0000 (+0100) Subject: Fix number of sessions wrongly increasing after log line validation. Thanks to Achill... X-Git-Tag: v9.2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82332526cdb3cb920798db0d930dc1070d829378;p=pgbadger Fix number of sessions wrongly increasing after log line validation. Thanks to Achilleas Mantzios for the report. --- diff --git a/pgbadger b/pgbadger index f18ae7f..a2ca10e 100644 --- a/pgbadger +++ b/pgbadger @@ -12230,6 +12230,8 @@ sub validate_log_line if (!$prefix_vars{'t_user'} && exists $current_sessions{$t_pid}{user}); $prefix_vars{'t_client'} = $current_sessions{$t_pid}{host} if (!$prefix_vars{'t_client'} && exists $current_sessions{$t_pid}{host}); + # Clear storage, the authorized session will be reparsed after + delete $current_sessions{$prefix_vars{'t_pid'}}; # Look at particular cases of vacuum/analyze that have the database # name inside the log message so that they could be associated @@ -12588,7 +12590,6 @@ sub parse_query /disconnection: session time: ([^\s]+) user=([^\s]+) database=([^\s]+) host=([^\s]+)/)) { return if ($disable_session); - delete $current_sessions{$prefix_vars{'t_pid'}}; if ($extension eq 'tsung') { $tsung_session{$prefix_vars{'t_pid'}}{disconnection}{date} = $prefix_vars{'t_timestamp'};