# Check start/end date time
if ($from) {
- if ($from !~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/) {
- die "FATAL: bad format for begin datetime, should be yyyy-mm-dd hh:mm:ss\n";
- }
+ if ($from !~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})([.]\d+([+-]\d+)?)?$/) {
+ die "FATAL: bad format for begin datetime, should be yyyy-mm-dd hh:mm:ss.l+tz\n";
+ } else {
+ my $fractional_seconds = $7 || "0";
+ $from = "$1-$2-$3 $4:$5:$6.$7"
+ }
+
}
if ($to) {
- if ($to !~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})$/) {
- die "FATAL: bad format for ending datetime, should be yyyy-mm-dd hh:mm:ss\n";
- }
+ if ($to !~ /^(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2}):(\d{2})([.]\d+([+-]\d+)?)?$/) {
+ die "FATAL: bad format for ending datetime, should be yyyy-mm-dd hh:mm:ss.l+tz\n";
+ } else {
+ my $fractional_seconds = $7 || "0";
+ $from = "$1-$2-$3 $4:$5:$6.$7"
+ }
}
# Stores the last parsed line from log file to allow incremental parsing