From 639f3582fea60d54092cb47146cdbde8976ae58f Mon Sep 17 00:00:00 2001 From: Matt Simerson Date: Tue, 20 Nov 2012 03:31:25 -0500 Subject: [PATCH] log/summarize: improve formatting so vertical columns are consistent, regardless of when the connection is ended. --- log/summarize | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/log/summarize b/log/summarize index b14dd3f..acf3c94 100755 --- a/log/summarize +++ b/log/summarize @@ -80,6 +80,7 @@ while ( defined (my $line = $fh->read) ) { next if $type ne 'connect'; # ignore unless connect my ($host, $ip) = split /\s/, $message; $ip = substr $ip, 1, -1; + foreach ( keys %seen_plugins, qw/ helo_host from to / ) { $pids{$pid}{$_} = ''; }; $pids{$pid}{ip} = $ip; $pids{$pid}{hostname} = $host if $host ne 'Unknown'; }; @@ -231,11 +232,11 @@ sub print_auto_format { $seen_plugins{$plugin}++; }; - next if ! $seen_plugins{$plugin}; # hide plugins not used + next if ! $seen_plugins{$plugin}; # hide unused plugins if ( $hide_plugins{$plugin} ) { # user doesn't want to see delete $pids{$pid}{$plugin}; next; - }; + }; if ( defined $pids{$pid}{helo_host} && $plugin =~ /helo/ ) { $format .= " %-18.18s";