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

[parser] nested json records will now have optional keys applied #167

Merged
merged 3 commits into from
Jun 8, 2017

Conversation

ryandeivert
Copy link
Contributor

@ryandeivert ryandeivert commented Jun 8, 2017

to @jacknagz , @mime-frame
cc @airbnb/streamalert-maintainers
resolves: #166
size: small

changes

  • Nested json records that get extracted via json_path will now have optional_top_level_keys applied.
  • Removing the need to call update on a schema to add the default value, and instead logging an error if the key does not exist in the schema. This informs the user that the optional_top_level_keys should also be declared as part of the schema in logs.json.

todo

  • A future PR is to come with a note added to the docs about the need for optional_top_level_keys to be declared in the schema.

@jacknagz
Copy link
Contributor

jacknagz commented Jun 8, 2017

Change looks good - please add a unit test case which uses optional_top_level_keys as well as json_path to verify

@ryandeivert ryandeivert force-pushed the ryandeivert-optional-top-level-key-bug branch from 3bdb55e to 0854671 Compare June 8, 2017 01:15
@ryandeivert
Copy link
Contributor Author

@jacknagz amended with new unit test. PTAL

Copy link
Contributor

@jacknagz jacknagz left a comment

Choose a reason for hiding this comment

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

💯

@ryandeivert ryandeivert merged commit caad577 into master Jun 8, 2017
@ryandeivert ryandeivert deleted the ryandeivert-optional-top-level-key-bug branch June 8, 2017 17:03
@ryandeivert ryandeivert added this to the 1.4.0 milestone Jun 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

optional_top_level_keys - unexpected outcome when coupled with json_path & envelope_keys
2 participants