-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add target
option to jdbc input
#69
Add target
option to jdbc input
#69
Conversation
…parameter is provided
target
option to jdbc input
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.
👍 code-wise looking good,
we'll need some input on "standardizing" the missing target message
lib/logstash/inputs/jdbc.rb
Outdated
|
||
# target must be populated if ecs_compatibility is not :disabled | ||
if @target.nil? && ecs_compatibility != :disabled | ||
logger.warn("When ECS compatibility is enabled also target option must be valued") |
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.
believe we agreed upon this being logger at the info
level (as a compromise since it might be legit to skip setting target
in cases where data has no conflicts with the schema).
what I would be also interested, due other plugins, is a standard message we would use across plugins ... draft:
ECS compatibility is enabled but no ``target`` option was specified, it is recommended to set the option to avoid potential schema conflicts (if you're data is ECS compliant or non-conflicting feel free to ignore this message)
// cc @yaauie @karenzone
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.
+1 on standardize, maybe we can put it as constant in the ECS mixin?
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.
@kares In another conversation for a different plugin, I believe we discussed emitting this as info
, since it isn't exactly something that needs to be resolved.
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.
Can you recall maybe the plugin?So that I can use the same log info, to be consistent across various plugins
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.
believe we agreed upon this being logger at the
info
level
yes we agreed on info level logging previously, we do not have another plugin with the "warning" yet.
that's why I proposed a message for review, if accepted we would use it here and maybe move to ECS support mixing for re-use (as @andsel suggested)? (it's going to concern 3 other plugins I can think of right away)
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.
logger.warn("When ECS compatibility is enabled also target option must be valued") | |
logger.info("ECS compatibility is enabled but no ``target`` option was specified, it is recommended to set the option to avoid potential schema conflicts (if you're data is ECS compliant or non-conflicting feel free to ignore this message)") |
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.
I think your message is perfect, in case of jdbc static and filter we would also add the id
of the interested lookups, so in that case it could hit many lines like this, one for each lookup definition
Co-authored-by: kaisecheng <[email protected]>
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.
just a slight typo that I had in the suggestion
Co-authored-by: Karol Bucek <[email protected]>
Co-authored-by: Karol Bucek <[email protected]>
eb17aef
to
7d58fbe
Compare
This PR adds the
target
option to configure destination field inside the event to the JDBC input.When ECS is enabled and the
target
is not specified it log a warn message.Related #19