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

Corrected parameter description for handle_dup_keys in the pipline ru… #17969

Merged
merged 15 commits into from Mar 15, 2024

Conversation

kodjo-anipah
Copy link
Contributor

@kodjo-anipah kodjo-anipah commented Jan 17, 2024

Description

Corrected parameter description for handle_dup_keys in the pipeline rule key_value function. If not specified, the function defaults to using the first encountered value for duplicate keys.

Motivation and Context

resolves #17892

How Has This Been Tested?

Locally Create a rule and add it to a pipeline:

rule "Test keys_array"
when
  true
then
  let output_1 = get_field(
    field : "message"
  );
  let output_2 = to_string(
    value : output_1
  );
  let output_3 = key_value(
    value : output_2,
    ignore_empty_values : true,
    allow_dup_keys : true,
    handle_dup_keys : "array"
  );
  set_fields(
    fields : output_3
  );
end

send in following example message via gelf input:

curl -X POST -H "Content-Type: application/json" -d '{"version": "1.1", "host": "example.com", "short_message": "test=1 test=2 test2=3", "facility": "gelf-test"}' http://localhost:12201/gelf

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

…ule key_value function. If not specified, the function defaults to using the first encountered value for duplicate keys.
@kodjo-anipah kodjo-anipah marked this pull request as ready for review January 22, 2024 09:36
Copy link
Contributor

@moesterheld moesterheld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the new default parameter in the rule builder. Thanks for adding that.
Changes LGTM, but please change the PR description as the array parameter value has been removed from the pr again due to having no additional value.

@kodjo-anipah kodjo-anipah merged commit 866c3b8 into master Mar 15, 2024
9 checks passed
@kodjo-anipah kodjo-anipah deleted the issue_17892 branch March 15, 2024 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

key_value function: parameter allow_dup_keys/handle_dup_keys missbehaving/wrong documentation
3 participants