X-Git-Url: http://git.pippins.net/embedvideo/.git/?a=blobdiff_plain;f=zfs-log-parser;fp=zfs-log-parser;h=f3619dbe912fc5caf4e13184119905a8304a37c8;hb=20a696fe558ae539023864c047543bb2e0e9f1a3;hp=dbb3c15a88a8e533a05ad30593c35755d84a0c7b;hpb=e868864af07febc5755735d451d74d9bc3ba170d;p=zfs-nexenta%2F.git diff --git a/zfs-log-parser b/zfs-log-parser index dbb3c15..f3619db 100755 --- a/zfs-log-parser +++ b/zfs-log-parser @@ -107,9 +107,9 @@ sub parse_snapshot_totals_logfile { elsif(($in_totals == 1) && ($line =~ /^\s+$/)) { $in_totals = 0; } - elsif(($in_totals == 1) && ($line =~ /(\S+)\s+([\d\.]+)(\w+)\s+(\d+)/)) { + elsif(($in_totals == 1) && ($line =~ /(\S+)\s+([\d\.]*)(\w+)\s+(\d+)/)) { $filesystem = $1; $data = $2; $size = $3; $num_snaps = $4; - if($filesystem =~ /Snapshots/) { next; } + if($filesystem =~ /Snapshots/ || $filesystem =~ /Total/) { next; } if($filesystem =~ /$backup_pool/) { next; } if(length($filesystem) > $maxlen) { $maxlen = length($filesystem); } if($size =~ /K/i) { $data = $data * $kilo; } @@ -129,6 +129,7 @@ sub parse_snapshot_totals_logfile { foreach $date (sort keys %$hashref) { if($date !~ /(\d+)-(\d+)-(\d+)/) { next; } $date_data=adjust_data($totals{$filesystem}{$date}{data}); + if($date_data eq "") { $date_data = "0"; } $data .= sprintf("%10s",$date_data). " "; $date_totals{$date}{data} += $totals{$filesystem}{$date}{data}; }