returning a list of file. If you want to pass log content from stdin
use - as filename. Note that input from stdin will not work with csvlog.
-
Options:
-a | --average minutes : number of minutes to build the average graphs of
if ($format eq 'csv') {
require Text::CSV;
my $csv = Text::CSV->new({binary => 1, eol => $/});
- open(my $io, "<", $logfile) or die "FATAL: cannot read csvlog file $logfile. $!\n";
+ my $io = undef;
+ if ($logfile !~ /\.gz/) {
+ open($io, "<", $logfile) or die "FATAL: cannot read csvlog file $logfile. $!\n";
+ } else {
+ open($io, "$zcat $logfile |") or die "FATAL: cannot open pipe to $zcat $logfile. $!\n";
+ # Real size of the file is unknow
+ $totalsize = 0;
+ }
# Parse csvlog lines
my $getout = 0;