-
Notifications
You must be signed in to change notification settings - Fork 188
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
Add inline template_content support to the opensearch sink #3431
Add inline template_content support to the opensearch sink #3431
Conversation
} | ||
|
||
if (templateContent != null && templateFile != null) { | ||
LOG.warn("Both template_content and template_file are configured. Only template_content will be used"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was there a particular reason you have the content take precedence over the file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not necessarily but if anything i am figuring the template_content will be more widely used
@@ -480,4 +529,12 @@ private Map<String, Object> initializeConfigMetaData( | |||
} | |||
return metadata; | |||
} | |||
|
|||
private String getTemplateContent() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This might be better named createTemplateContent()
to avoid signaling that it is a "getter" method.
Can we call it index template to be inline with standard naming --> https://opensearch.org/docs/latest/im-plugin/index-templates/. Like in this API PUT _index_template/ , in pipeline it can be called as index_template |
The API for v1 templates is |
The existing parameters only use the term "template." Also, if you read the OpenSearch documentation, you can see that it continues to use the term "template" for generic templates. This new Data Prepper parameter allows for configuring the template whether it is an "index template" or a "v1 template." Thus, the term "template" appears to fit well here. |
Signed-off-by: Taylor Gray <tylgry@amazon.com>
Signed-off-by: Taylor Gray <tylgry@amazon.com>
6b54d56
to
24cc685
Compare
The backport to
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.5 2.5
# Navigate to the new working tree
cd .worktrees/backport-2.5
# Create a new branch
git switch --create backport/backport-3431-to-2.5
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 e19ae8f2302b096363229abad77c1ab5a2042569
# Push it to GitHub
git push --set-upstream origin backport/backport-3431-to-2.5
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-2.5 Then, create a pull request where the |
…h-project#3431) Signed-off-by: Taylor Gray <tylgry@amazon.com> (cherry picked from commit e19ae8f)
…h-project#3431) Signed-off-by: Taylor Gray <tylgry@amazon.com> (cherry picked from commit e19ae8f)
Description
Adds a
template_content
parameter for inline index templates in the OpenSearch sink. This can be used as an alternative totemplate_file
Issues Resolved
Resolves #3365
Check List
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.