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

Define multiple keys for type conversion #2934

Merged
merged 10 commits into from
Jul 5, 2023

Conversation

wanghd89
Copy link
Contributor

@wanghd89 wanghd89 commented Jun 26, 2023

Description

Allow defining multiple keys in the convert_entry_type processor.

Note: existing key still works. But only One Of (key or Keys) is required.
If all of them defined or Non of them defined, will throw exception.

eg:

processor:
    - convert_entry_type:
         keys: ["key1", "key2"]
         type: "integer"

converts
{"message":"value","key1":"123", "key2":"456"}
to
{"message":"value","key1":123, "key2":456}

Issues Resolved

Resolve #2823

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added
  • Commits are signed with a real name per the DCO

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.

Copy link
Collaborator

@asifsmohammed asifsmohammed left a comment

Choose a reason for hiding this comment

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

Changes looks good, just missing the documentation

Signed-off-by: Haidong <[email protected]>
@wanghd89
Copy link
Contributor Author

Changes looks good, just missing the documentation

Ok, updated README

@asifsmohammed asifsmohammed merged commit d93ead9 into opensearch-project:main Jul 5, 2023
24 checks passed
rajeshLovesToCode pushed a commit to rajeshLovesToCode/data-prepper that referenced this pull request Jul 5, 2023
* feat: add include_key options to KeyValueProcessor

Signed-off-by: Haidong <[email protected]>

---------

Signed-off-by: Haidong <[email protected]>
Co-authored-by: Haidong <[email protected]>
Signed-off-by: rajeshLovesToCode <[email protected]>
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.3 failed:

The process '/usr/bin/git' failed with exit code 1

To backport manually, run these commands in your terminal:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-2.3 2.3
# Navigate to the new working tree
cd .worktrees/backport-2.3
# Create a new branch
git switch --create backport/backport-2934-to-2.3
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 d93ead9f39588a3fb5d7c0d20df11a8875070fce
# Push it to GitHub
git push --set-upstream origin backport/backport-2934-to-2.3
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.3

Then, create a pull request where the base branch is 2.3 and the compare/head branch is backport/backport-2934-to-2.3.

MaGonzalMayedo pushed a commit to MaGonzalMayedo/data-prepper that referenced this pull request Jul 25, 2023
* feat: add include_key options to KeyValueProcessor

Signed-off-by: Haidong <[email protected]>

---------

Signed-off-by: Haidong <[email protected]>
Co-authored-by: Haidong <[email protected]>
Signed-off-by: Marcos Gonzalez Mayedo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Define multiple keys for type conversion
3 participants