added date-df header for .log files
authorDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 27 Jun 2023 09:37:36 +0000 (11:37 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Tue, 27 Jun 2023 09:37:36 +0000 (11:37 +0200)
lib/MojoFacets/Import/Log.pm

index 49be8fd..e0f03b1 100644 (file)
@@ -19,11 +19,13 @@ sub data {
        my $data = { items => [] };
        my $need_header = 1;
 
+       my @header;
+       @header = qw(Filesystem 1K-blocks Used Available Use% Mounted-on) if $path =~ m/date-df/;
+
        open(my $fh, $path) || die "$path: $!";
        while(<$fh>) {
                chomp;
                warn "## $_\n";
-               my @header;
 
                chomp;
                my @v = split(/\s/, $_);