-
Notifications
You must be signed in to change notification settings - Fork 201
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
Key value processor enhancements #4521
Key value processor enhancements #4521
Conversation
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
@JsonProperty("key_value_when") | ||
private String keyValueWhen; | ||
|
||
@AssertTrue(message = "Invalid Configuration. valueGrouping option and field_delimiter_regex are mutually exclusive") |
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.
Nit: value_grouping
@@ -496,6 +586,9 @@ private Map<String, Object> executeConfigs(Map<String, Object> map) { | |||
processed.put(pair.getKey(), pair.getValue()); | |||
} | |||
|
|||
if (keyValueProcessorConfig.getDropKeysWithNoValue()) { |
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 like there may not be unit tests for this
|
||
public int findInStartGroup(final String str, int idx) { | ||
int j = 0; | ||
while (j < startGroupStrings.length) { |
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.
Is there reason not to use for loop?
Signed-off-by: Krishna Kondaka <krishkdk@dev-dsk-krishkdk-2c-bd29c437.us-west-2.amazon.com>
Description
Two new config options are added
value_grouping: true/false
This option groups the values when values start with "(" "[" "<" "{" , single quote, double quote and "http://" and "https://"
When a value starts with one of the above mentioned strings, all the characters after that are considered part of the value until the corresponding end character is found (ie no keyvalue or field value parsing happens). If the corresponding end character is not found, an error is displayed. When this option is enabled,
field_delimiter_regex
option is not allowed. All other existing options are valid with this config option.drop_keys_with_no_value:true/false
This option drops keys that do not have a value associated with them. This is done after
default_values
option is processed. Even after default values are assigned, if keys havenull
value, they are dropped when this config option is set to trueIssues Resolved
Resolves #4447
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.