-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
enhancement(regex_parser transform): Add support for target_field
#2023
Conversation
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
src/transforms/regex_parser.rs
Outdated
#[serde(default, deny_unknown_fields)] | ||
pub struct RegexParserConfig { | ||
pub regex: String, | ||
pub field: Option<Atom>, | ||
#[derivative(Default(value = "false"))] |
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.
#[derivative(Default(value = "false"))] | |
#[derivative(Default(value = "true"))] |
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.
This follows the lead of other parser transforms like json_parser
that default to false
.
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.
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.
That would be the default for drop_field
, which is a different setting.
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.
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.
Ah I see it now, sorry. That was part of a lead up patch that I had forgotten about. Will fix. Odd that no test caught it, though.
Nice work. Everything else, docs wise, looks good to me. |
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'm curious how people feel about the overwrite_target
option. I'm not sure it's useful enough to warrant the additional implementation complexity, but there may be use cases I'm not thinking about.
(I could have sworn we talked about this somewhere but now I can't find it)
I'm indifferent, but I tend to agree it adds confusion to the UX as well. My opinion is not strong. |
Signed-off-by: Bruce Guenter <[email protected]>
target_field
target_field
So where are we with |
Leave it and default it to |
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: Bruce Guenter <[email protected]>
Signed-off-by: binarylogic <[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.
Looks good!
Merging so that we can get this in |
Closes #1812