]> granicus.if.org Git - pgbadger/commitdiff
Fix number of sessions wrongly increasing after log line validation. Thanks to Achill...
authorDarold Gilles <gilles@darold.net>
Mon, 6 Feb 2017 13:28:25 +0000 (14:28 +0100)
committerDarold Gilles <gilles@darold.net>
Mon, 6 Feb 2017 13:28:25 +0000 (14:28 +0100)
pgbadger

index f18ae7fa6b38bbba858bab9cb91d95c6f5bfcb61..a2ca10ef0ac913c004610566de07f021fd320a2c 100644 (file)
--- 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'};