opensearch-project / opensearch-project/data-prepper

Add a fallback index in the opensearch index config for dynamic indexes

Open
#2,234 9 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement plugin - sink
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.
Opensearch Sink allows dynamic index names in the form of index: test-${propa}-${propb} and values for propa and propb are extracted from the event. If the event does not have any of the keys that are part of the index name, then the event is dropped. This is not a very desirable thing.

Describe the solution you'd like
A clear and concise description of what you want to happen.
This feature request proposes adding a new opensearch sink config option called fallback_index, to be used only if the primary index is a dynamic index, to store the events for which a dynamic index could not be created.

sink:
    - opensearch:
        index: test-${propa}-${propb}
        fallback_index: test-fallback-index

Describe alternatives you've considered (Optional)
Alternative is to use null string when a field is missing in the event. In the example above, if the dynamic index is test-${propa}-${propb} and the event is missing value for propa but has a value of xxx for propb, the index name would be test--xxx. But if propb is also missing, it would become test--. Also, if the dynamic index is ${propa}-${propb} and both fields are missing in the event, the index name would become -, and in absolute worst case, if there is no - in the dynamic index, it would become empty string for index name and it will be failed to be stored.

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.

Research direction

Start by locating the OpenSearch sink configuration and the dynamic index resolution path. Review existing sink tests, then verify that events whose dynamic index cannot be created are stored in fallback_index while normal dynamic indexes continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, data
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.