Add scripts from the tools directory in the private Candela repo.

These scripts will now be publicly available in a git repo for
easier shared development and change tracking.
This commit is contained in:
Ben Greear
2017-10-06 13:41:50 -07:00
parent 3abf1ca06e
commit 72712ff548
61 changed files with 23383 additions and 0 deletions

22
lf_log_parse.pl Executable file
View File

@@ -0,0 +1,22 @@
#!/usr/bin/perl
# Convert the timestamp in LANforge logs (it is in unix-time, miliseconds)
# to readable date.
use strict;
use POSIX qw(strftime);
while (<>) {
my $ln = $_;
chomp($ln);
if ($ln =~ /^(\d+):(.*)/) {
my $ts = $1;
my $rst = $2;
my $dt = strftime("%Y-%m-%d %H:%M:%S", localtime($ts / 1000));
my $msec = $ts % 1000;
print "$dt $msec:$rst\n";
}
else {
print "$ln\n";
}
}