You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add generic script support for update/upsert operations in OpenSearch sink
Adds the ability to configure a script on the OpenSearch sink that gets
applied to update and upsert bulk operations. This is a generic mechanism
that passes script source and params through to OpenSearch's bulk API.
Script language is hardcoded to painless. The event document is
automatically passed as params.doc. scripted_upsert is always true
so the script runs on every write including the first create.
Script param values support ${} expression syntax for dynamic
resolution from event fields or metadata.
Configuration example:
sink:
- opensearch:
hosts: ["https://localhost:9200"]
index: "my-index"
action: "upsert"
document_id: "${/id}"
script:
source: "ctx._source.putAll(params.doc); ctx._source.source = params.table"
params:
table: "${getMetadata(\"table_name\")}"
Resolves#3563
Signed-off-by: Dinu John <86094133+dinujoh@users.noreply.github.com>
Copy file name to clipboardExpand all lines: data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/OpenSearchSink.java
Copy file name to clipboardExpand all lines: data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/configuration/OpenSearchSinkConfig.java
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -164,6 +164,22 @@ public boolean getEnableRequestCompression() {
Copy file name to clipboardExpand all lines: data-prepper-plugins/opensearch/src/main/java/org/opensearch/dataprepper/plugins/sink/opensearch/index/IndexConfiguration.java
0 commit comments