Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logparser divide by zero #4338

Merged
merged 3 commits into from
Aug 30, 2018
Merged

Logparser divide by zero #4338

merged 3 commits into from
Aug 30, 2018

Conversation

Ayrdrie
Copy link
Contributor

@Ayrdrie Ayrdrie commented Jun 22, 2018

Resolves #3438

  • Signed CLA.
  • Has appropriate unit tests.

@danielnelson
Copy link
Contributor

I like defaulting the year to the current year, seems very unlikely anyone legitimately has logs in year 0, but I think there may be additional paths that could cause the crash such as in the GENERIC_TIMESTAMP case.

One issue though is that this still leaves the panic in tsMod, and I think it will be easy to have regressions if this code is modified. Is it possible to fix the bug in that function so that any time.Time can be passed in?

@danielnelson danielnelson added area/tail fix pr to fix corresponding bug labels Jul 14, 2018
Copy link
Contributor

@danielnelson danielnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to address the cause of the crash in tsmod, this prevents it from being called with a zero year in some cases but doesn't solve the underlying issue.

@danielnelson danielnelson added this to the 1.8.0 milestone Aug 25, 2018
@danielnelson danielnelson merged commit 5420e13 into master Aug 30, 2018
@danielnelson danielnelson deleted the logparser-divide-by-zero branch August 30, 2018 02:11
rgitzel pushed a commit to rgitzel/telegraf that referenced this pull request Oct 17, 2018
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
otherpirate pushed a commit to otherpirate/telegraf that referenced this pull request Mar 15, 2019
dupondje pushed a commit to dupondje/telegraf that referenced this pull request Apr 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/tail fix pr to fix corresponding bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants