Skip to content

Commit

Permalink
Check if timestamp regex matches the replay line and skip if it fails
Browse files Browse the repository at this point in the history
  • Loading branch information
FTWynn committed Feb 13, 2016
1 parent b9fe555 commit e4f8ad2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,15 @@ func storeDataFileLogLines(confData GlobalConfStore) (logLines []loggensender.Lo
}).Debug("Current replay line")

match := timeRegex.FindStringSubmatch(line)

if match == nil {
log.WithFields(log.Fields{
"Regex": replayFile.TimestampRegex,
"line": line,
}).Warn("Timestamp regex doesn't match the current line in the replay file, skipping line")
continue
}

log.WithFields(log.Fields{
"whole timestamp match": match,
"timeRegex.SubexpName()": timeRegex.SubexpNames(),
Expand Down

0 comments on commit e4f8ad2

Please sign in to comment.