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

Injecting timestamp in index name that is not a suffix throws IllegalArgumentException #3957

Closed
graytaylor0 opened this issue Jan 12, 2024 · 1 comment · Fixed by #4000
Closed
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@graytaylor0
Copy link
Member

Describe the issue
When using the OpenSearch sink with timestamp formats such as index-%{yyyyMMdd}-test, the OpenSearch sink throws an IllegalArgumentException on startup after validating that this format is being injected in a suffix such as index-test-%{yyyyMMdd}

2024-01-11T18:56:53,018 [log-pipeline-sink-worker-2-thread-1] ERROR org.opensearch.dataprepper.pipeline.common.PipelineThreadPoolExecutor - Pipeline [log-pipeline] process worker encountered a fatal exception, cannot proceed further
java.util.concurrent.ExecutionException: java.lang.IllegalArgumentException: Time pattern can only be a suffix of an index.
	at java.base/java.util.concurrent.FutureTask.report(FutureTask.java:122) ~[?:?]
	at java.base/java.util.concurrent.FutureTask.get(FutureTask.java:191) ~[?:?]

There is no reason/limitation that requires this timestamp injection to be as a suffix, so injection of this timestamp into the index at any point should be supported.

This validation occurs here (

), and should be removed. Additionally, the formatter should be expanded to not be specific to suffixes like it is here ( )

Additional context
Add any other context about the problem here.

@dlvenable
Copy link
Member

OpenSearch does support index patterns with wildcards in the middle. So this should be possible.

However, we need to check various parts of our code. We currently have some code scattered throughout the opensearch sink which assumes the wildcard is at the end. In particular, this is how we determine the alias. We might want to think about what the right alias would be for such a pipeline.

With the example above (index-%{yyyyMMdd}-test), would the index alias be index or index-test? I tend to think the latter.

@oeyh oeyh self-assigned this Jan 22, 2024
@dlvenable dlvenable added this to the v2.7 milestone Jan 22, 2024
@github-project-automation github-project-automation bot moved this from Unplanned to Done in Data Prepper Tracking Board Jan 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

3 participants