X-Git-Url: http://git.pippins.net/embedvideo/.git/static/git-logo.png?a=blobdiff_plain;f=zfs-log-parser;h=560cba229fe6543afd968ac881118e98532ee5cd;hb=9eb1c325c28f5608ae26eeccc161f1fc5f70b083;hp=94e4490b500a581b623dc6daa681eabb4e1735ff;hpb=984d48e66a916fd9ba533ae19b43aafd449dad77;p=zfs-ubuntu%2F.git diff --git a/zfs-log-parser b/zfs-log-parser index 94e4490..560cba2 100755 --- a/zfs-log-parser +++ b/zfs-log-parser @@ -66,9 +66,9 @@ sub parse_replicate_logfile { } if(($in_replicate == 1) && ($line =~ /received ([\d\.]+)(\w+)/)) { $data = $1; $size = $2; - if($size =~ /Kb/i) { $data = $data * $kilo; } - if($size =~ /Mb/i) { $data = $data * $mega; } - if($size =~ /Gb/i) { $data = $data * $giga; } + if($size =~ /(Kb|K)/i) { $data = $data * $kilo; } + if($size =~ /(Mb|M)/i) { $data = $data * $mega; } + if($size =~ /(Gb|G)/i) { $data = $data * $giga; } chomp($line); $totals{$date}{data} += $data; } @@ -117,7 +117,7 @@ sub parse_snapshot_totals_logfile { elsif(($in_totals == 1) && ($line =~ /(\S+)\s+([\d\.]*)(\w+)\s+(\d+)/)) { $filesystem = $1; $data = $2; $size = $3; $num_snaps = $4; if($filesystem =~ /Snapshots/ || $filesystem =~ /Total/) { next; } - if($filesystem =~ /$backup_pool/) { next; } + if($filesystem =~ /^$backup_pool/) { next; } if(length($filesystem) > $maxlen) { $maxlen = length($filesystem); } if($size =~ /K/i) { $data = $data * $kilo; } if($size =~ /M/i) { $data = $data * $mega; }