-
Notifications
You must be signed in to change notification settings - Fork 190
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 support for using expressions with formatString in JacksonEvent, use for index in OpenSearch sink #3032
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -87,20 +87,13 @@ opensearch-source-pipeline: | |
hosts: [ "https://source-cluster:9200" ] | ||
username: "username" | ||
password: "password" | ||
processor: | ||
- add_entries: | ||
entries: | ||
- key: "document_id" | ||
value_expression: "getMetadata(\"document_id\")" | ||
- key: "index" | ||
value_expression: "getMetadata(\"index\")" | ||
sink: | ||
- opensearch: | ||
hosts: [ "https://sink-cluster:9200" ] | ||
username: "username" | ||
password: "password" | ||
document_id_field: "document_id" | ||
index: "copied-${index}" | ||
document_id_field: "getMetadata(\"opensearch-document_id\")" | ||
index: "${getMetadata(\"opensearch-index\"}" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WHat's the difference between There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. document_id_field currently only supports a single field in the Event. It does not support formatting the document id like is done in index. We could add later potentially but right now document id either supports a field in the Event or it supports an expression |
||
``` | ||
|
||
## Configuration | ||
|
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.
can
val
here be null? If yes, the statement in line 342(below) will result in null pointer exception. Probably good idea to put null check in line 337 outside of if statement.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.
if the result of the evaluate method is null, should be just have it be literal string "null"? Or should we just leave it out of the format string?
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.
I added a null check around the appending to the result