opensearch-project / opensearch-project/data-prepper

Support multiple entries of source + list_to_map_when condition in list-to-map processor

Open
#5,368 0 comments 0 reactions 1 assignee View on GitHub

@niketan16 is already working on this.

Since Jan 29, 2025.

enhancement
Dominant language
Java
Stars
374
Forks
354
Avg merge
3d 18h
Merged PRs (30d)
8

Description

Is your feature request related to a problem? Please describe.
Allow the list-to-map processor to convert multiple sources (a list of objects from an event) to maps of keys to objects under different conditions.

Describe the solution you'd like
Modify list-to-map processor to support this new configuration that allows multiple entries of source and list_to_map_when conditions like shown below. The existing configuration is still supported. This is new config under entries needs to be added.

processor:
    - list_to_map:
        entries:
           - source: "mylist"
             key: "name"
             value_key: "value"
             flatten: true
             list_to_map_when: "some-key == 'test'"
           - source: "mylist2"
             key: "name2"
             value_key: "value2"
             flatten: true
             list_to_map_when: "some-key2 == 'test2'"

Describe alternatives you've considered (Optional)
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.