-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
feat(parser/json): continue parsing JSON after invalid object in array, with an option of strict to enforce validity of all objects #6536
feat(parser/json): continue parsing JSON after invalid object in array, with an option of strict to enforce validity of all objects #6536
Conversation
Closes #6532 |
plugins/parsers/json/parser.go
Outdated
@@ -73,7 +76,14 @@ func (p *Parser) parseArray(data []interface{}) ([]telegraf.Metric, error) { | |||
case map[string]interface{}: | |||
metrics, err := p.parseObject(v) | |||
if err != nil { | |||
return nil, err | |||
log.Printf("E! [parsers.json] Invalid JSON object: %v", v) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this log message since we are returning the error.
…y, with an option of strict to enforce validity of all objects
Hi @rawkode, Could it be that there is some error in this feature or description? I'm getting weird error when trying to use example configuration for JSON: |
@VitaliyBreslavskyi Can you open a new issue and provide your configuration file, please? Thanks |
Sure, in progress... |
closes #6532
Required for all PRs: