-
Notifications
You must be signed in to change notification settings - Fork 7
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 @metadata for ENV variables #5
Conversation
This is in response to elastic/logstash#3944 (comment) |
What if some users want fields loaded from environment variables? They need to explicitly copy it from |
Yes, exactly. Explicit copy if they want it in the output. It seems it's much more likely to be used for filtering than for output, though. |
+1, LGTM |
And if included, it's also more likely to be used in sprintf format. |
@untergeek can you also update the docs to reflect this change? i.e lets make it more explicit how to use this on the top of the class. We can also stick in an example where an explicit copy can be used |
@suyograo you mean beyond what I already put in line 11? |
I may have pushed that commit right before you saw it. |
@untergeek I'd also like to have something described at the top of the class: https://github.com/untergeek/logstash-filter-environment/blob/feature/4/lib/logstash/filters/environment.rb#L6 Users typically read this description before they dive into config -- "This filter lets you access environment variables and sets it in metadata field, blah, blah. You can then use it in other parts of pipeline ... . To make this part of your event in your destination, you need to copy .." |
@untergeek Thanks for the rapid response, this is a great change and the first time I've seen the As for the Thanks again! |
Thanks for the feedback, @cstockton We have the opportunity with the coming of Logstash 2.0 to make some breaking changes. While I agree about the effect it will have on users, and the need to change their configurations to make use of Unless a plurality of the other Logstash team members want to add the complexity, I think we'll probably stick with the current, simple configuration as it stands. We'll add plenty of documentation and notification before we actually publish the updated gem, even if that comes before the 2.0 release. |
@untergeek thoughts about renaming This change in config will make LS not start and provide a stronger safety net. Also it reflects the change in behavior. Thoughts? |
That makes good sense. I'll merge that in. |
d9b6985
to
d61cf96
Compare
# Adding environment variables is as easy as: | ||
# filter { | ||
# environment { | ||
# add_field_from_env { "field_name" => "ENV_VAR_NAME" } |
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.
add_metadata_from_env
@untergeek minor comment in doc to update to |
This is a breaking change. This could cause issues for existing users. Make semver-esque major version number bump Improve internal documentation Updated documentation Use add_metadata_from_env This makes the change a breaking one. `add_metadata_from_env` replaces `add_field_from_env`. Fix doc Missed the second `add_metadata_from_env` change.
d61cf96
to
0ccd77d
Compare
This is a breaking change. This could cause issues for existing users. Make semver-esque major version number bump Improve internal documentation Updated documentation Use add_metadata_from_env This makes the change a breaking one. `add_metadata_from_env` replaces `add_field_from_env`. Fix doc Missed the second `add_metadata_from_env` change. Missed another add_field_from_env ref
0ccd77d
to
4db63b7
Compare
…ter-environment into untergeek-feature/4 Conflicts: lib/logstash/filters/environment.rb
Conflicts: logstash-filter-environment.gemspec
Use @metadata for ENV variables
This is a breaking change. We should do some notification if we publish this gem.