From 99d9aa527fad3b987aaf37d43f113fc0d1cfb0fd Mon Sep 17 00:00:00 2001
From: "Alan J. Pippin" <ajp@pippins.net>
Date: Thu, 21 Aug 2008 21:23:53 -0600
Subject: [PATCH] Added support for handling compressed files

---
 zfs-log-parser | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/zfs-log-parser b/zfs-log-parser
index 2167493..4ecca3c 100755
--- a/zfs-log-parser
+++ b/zfs-log-parser
@@ -159,7 +159,11 @@ sub parse_snapshot_totals_logfile {
 # MAIN
 #########
 #print "-> Parsing $logfile\n";
-open(FILE,"$logfile") || die "-E- Unable to open $logfile\n";
+if("$logfile" =~ /\.[bz2|gz]/) { 
+  open(FILE,"zcat $logfile|") || die "-E- Unable to open $logfile\n";
+} else {
+  open(FILE,"$logfile") || die "-E- Unable to open $logfile\n";
+}
 
 if($logfile =~ /replicate/) { parse_replicate_logfile(); }
 if($logfile =~ /snapshot-totals/) { parse_snapshot_totals_logfile(); }
-- 
2.34.1