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

fix(parsers.grok): Fix nil metric for multiline inputs #13078

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

srebhan
Copy link
Contributor

@srebhan srebhan commented Apr 12, 2023

When parsing multiline inputs that do not match the given pattern the parser currently returns a nil metric in the metrics array. In turn this can lead to a panic when the parent plugin loops through the returned metrics and tries to process them (e.g. inputs.tail).

This PR checks if the metric is nil and does not add it to the returned metrics array. Thus the array is empty and upstream plugins will not panic.

@telegraf-tiger telegraf-tiger bot added fix pr to fix corresponding bug plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins labels Apr 12, 2023
@srebhan srebhan added the ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review. label Apr 12, 2023
@powersj powersj merged commit 302ac88 into influxdata:master Apr 12, 2023
5 checks passed
powersj pushed a commit that referenced this pull request Apr 24, 2023
@knollet knollet mentioned this pull request May 2, 2023
@srebhan srebhan added this to the v1.26.2 milestone Jun 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix pr to fix corresponding bug plugin/parser 1. Request for new parser plugins 2. Issues/PRs that are related to parser plugins ready for final review This pull request has been reviewed and/or tested by multiple users and is ready for a final review.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants