Reset/flush saved contents from bad metric (#4646)

This commit is contained in:
Greg 2018-09-06 18:45:40 -06:00 committed by GitHub
parent cd4c4e7fbd
commit e9eeda555e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -63,6 +63,7 @@ func (p *Parser) Parse(input []byte) ([]telegraf.Metric, error) {
for p.machine.ParseLine() {
err := p.machine.Err()
if err != nil {
p.handler.Reset()
return nil, &ParseError{
Offset: p.machine.Position(),
msg: err.Error(),