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

Correctly handle null values in nested structures in JsonExtractor #1677

Merged
merged 2 commits into from Jan 11, 2016
Merged

Conversation

@joschi
Copy link
Contributor

@joschi joschi commented Jan 7, 2016

The JSON extractor currently fails to handle null values in nested structures like arrays or objects and throws a NullPointerException instead.

This PR changes the behavior to simply ignore the null values in those cases (array item, dictionary key and value).

Fixes #1676

@joschi joschi modified the milestones: 1.x, 1.3.3 Jan 7, 2016
@bernd bernd self-assigned this Jan 11, 2016
@bernd
Copy link
Member

@bernd bernd commented Jan 11, 2016

This PR changes the behavior to use the string "null" as a replacement for null values in those cases.

This would be inconsistent with null handling in other cases. We do not store a field in the message for null valued fields.

@joschi joschi force-pushed the issue-1676 branch from ce90e74 to 33a0078 Jan 11, 2016
@joschi
Copy link
Contributor Author

@joschi joschi commented Jan 11, 2016

@bernd True, I've updated the PR accordingly.

@bernd
Copy link
Member

@bernd bernd commented Jan 11, 2016

LGTM 👍

bernd added a commit that referenced this pull request Jan 11, 2016
Correctly handle null values in nested structures in JsonExtractor
@bernd bernd merged commit 764942b into 1.3 Jan 11, 2016
2 of 3 checks passed
2 of 3 checks passed
@garybot2
ci Jenkins build graylog2-server-integration-pr 489 has failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@bernd bernd deleted the issue-1676 branch Jan 11, 2016
bernd added a commit that referenced this pull request Jan 11, 2016
Correctly handle null values in nested structures in JsonExtractor
(cherry picked from commit 764942b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants