in reply to Re^2: Simple awk question
in thread Simple awk question
$time = print $error|print $F[0];
That attempt to pipe one statement to another statement like you would do when piping shell commands won't work.
You've already been shown a couple ways to extract the datestamp.
$error = '2014-06-04T15:24:21-05:00 syslog_dp [0x80e00099][ftp][error] + secure-backup(FBB): trans(5487)'; $time = (split /\s/, $error)[0]; print $time, "\n"; # or you could do this: ($time) = $error =~ /^(\S+)/; print $time, "\n";
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^4: Simple awk question
by czah7 (Initiate) on Jun 05, 2014 at 19:29 UTC | |
by GotToBTru (Prior) on Jun 05, 2014 at 20:15 UTC | |
by czah7 (Initiate) on Jun 05, 2014 at 21:24 UTC |
In Section
Seekers of Perl Wisdom