}
my $tags = $ENV{TAGS};
-$tags = ",$tags" unless $tags =~ m/^,/;
+$tags = ",$tags" if $tags && $tags !~ m/^,/;
while(<>) {
chomp;
my @vals;
- if ( /^(\w+)\s+(\d+\S+)\s+(.+)\s+(\w+)\s+(\d\d\d\d)\/(\d\d)\/(\d\d)$/ ) {
+ if ( /^([\w\-]+)\s+(\d+\S+)\s+(.+)\s+(\w+)\s+(\d\d\d\d)\/(\d\d)\/(\d\d)$/ ) {
$host = $1;
@cols = qw( kernel build arch );
@vals = ( qq{"$2"}, qq{"$3"}, qq{"$4"} ); # must quote all this as strings for influx
} elsif ( m/^\s+(.+)/ ) {
@vals = split(/\s+/, $1);
} else {
- die "UNPARSED: $_\n";
+ warn "UNPARSED: $_\n";
}
next unless @vals;
next if $measurement =~ /top3/; # FIXME this isn't parsed yet
#XXX { cols => \@cols, vals => \@vals };
- print "atop_$measurement,host=$host$tags";
+ print "$measurement,host=$host$tags";
my $d = " ";
foreach my $i ( 0 .. $#cols ) {
if ( my $c = $cols[$i] ) {