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

use fieldref to properly assign event field data #56

Merged

Conversation

colinsurprenant
Copy link
Contributor

this change is necessary to support the future Java Event.

The previous construct

event[@target][key] = foo

is actually: 1- fetch field reference @target and return value, 2- create key in value and assign foo.
this actually assumes the mutability of event[@target] by its reference, which work but is an actual implementation side-effect and not a contract.

The correct way to assign Event field values is by using proper field references

event["[#{@target}][#{key}]"]

This relates to elastic/logstash#4264 and elastic/logstash#4191

@jsvd
Copy link
Member

jsvd commented Dec 3, 2015

LGTM

@colinsurprenant
Copy link
Contributor Author

thanks, will bump version and merge!

@colinsurprenant colinsurprenant merged commit 1d0c9c4 into logstash-plugins:master Dec 15, 2015
@colinsurprenant
Copy link
Contributor Author

pushed version 2.0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants