log/summarize: improve formatting so vertical

columns are consistent, regardless of when the connection is ended.
This commit is contained in:
Matt Simerson 2012-11-20 03:31:25 -05:00
parent a5803d10f5
commit 639f3582fe

View File

@ -80,6 +80,7 @@ while ( defined (my $line = $fh->read) ) {
next if $type ne 'connect'; # ignore unless connect next if $type ne 'connect'; # ignore unless connect
my ($host, $ip) = split /\s/, $message; my ($host, $ip) = split /\s/, $message;
$ip = substr $ip, 1, -1; $ip = substr $ip, 1, -1;
foreach ( keys %seen_plugins, qw/ helo_host from to / ) { $pids{$pid}{$_} = ''; };
$pids{$pid}{ip} = $ip; $pids{$pid}{ip} = $ip;
$pids{$pid}{hostname} = $host if $host ne 'Unknown'; $pids{$pid}{hostname} = $host if $host ne 'Unknown';
}; };
@ -231,7 +232,7 @@ sub print_auto_format {
$seen_plugins{$plugin}++; $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 if ( $hide_plugins{$plugin} ) { # user doesn't want to see
delete $pids{$pid}{$plugin}; delete $pids{$pid}{$plugin};
next; next;