Skip to content

Commit

Permalink
Add check for timestamp in tsModder
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayrdrie Palmer authored and danielnelson committed Aug 25, 2018
1 parent be9df91 commit 0a11b4b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/parsers/grok/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,6 +488,9 @@ type tsModder struct {
// most significant time unit of ts.
// ie, if the input is at ms precision, it will increment it 1µs.
func (t *tsModder) tsMod(ts time.Time) time.Time {
if ts.IsZero() {
return ts
}
defer func() { t.last = ts }()
// don't mod the time if we don't need to
if t.last.IsZero() || ts.IsZero() {
Expand Down

0 comments on commit 0a11b4b

Please sign in to comment.