From aac615c38e59a7ecebc52366ae15b0ea89b5b124 Mon Sep 17 00:00:00 2001 From: Zhanibek Adilbekov Date: Sat, 11 Sep 2021 09:13:41 +0600 Subject: [PATCH 1/2] feat: write_operation docs taken from https://github.com/uken/fluent-plugin-elasticsearch/blob/master/README.md#write_operation Signed-off-by: Zhanibek Adilbekov --- pipeline/outputs/elasticsearch.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/pipeline/outputs/elasticsearch.md b/pipeline/outputs/elasticsearch.md index 56872c1b6..8d31f6435 100644 --- a/pipeline/outputs/elasticsearch.md +++ b/pipeline/outputs/elasticsearch.md @@ -36,6 +36,7 @@ The **es** output plugin, allows to ingest your records into an [Elasticsearch]( | Tag\_Key | When Include\_Tag\_Key is enabled, this property defines the key name for the tag. | \_flb-key | | Generate\_ID | When enabled, generate `_id` for outgoing records. This prevents duplicate records when retrying ES. | Off | | Id\_Key | If set, `_id` will be the value of the key from incoming record and `Generate_ID` option is ignored. | | +| Write\_Operation | The write\_operation can be any of: index (default), create, update, upsert. | index | | Replace\_Dots | When enabled, replace field name dots with underscore, required by Elasticsearch 2.0-2.3. | Off | | Trace\_Output | When enabled print the elasticsearch API calls to stdout \(for diag only\) | Off | | Trace\_Error | When enabled print the elasticsearch API calls to stdout when elasticsearch returns an error \(for diag only\) | Off | @@ -49,6 +50,19 @@ The **es** output plugin, allows to ingest your records into an [Elasticsearch]( Elasticsearch output plugin supports TTL/SSL, for more details about the properties available and general configuration, please refer to the [TLS/SSL](tcp-and-tls.md) section. +### write\_operation + +The write\_operation can be any of: + +| Operation | Description | +| ------------- | ----------- | +| index (default) | new data is added while existing data (based on its id) is replaced (reindexed).| +| create | adds new data - if the data already exists (based on its id), the op is skipped.| +| update | updates existing data (based on its id). If no data is found, the op is skipped.| +| upsert | known as merge or insert if the data does not exist, updates if the data exists (based on its id).| + +**Please note, id is required in create, update, and upsert scenario. Without id, the message will be dropped.** + ## Getting Started In order to insert records into a Elasticsearch service, you can run the plugin from the command line or through the configuration file: From 40dfa113e63252ff6f2c19c32e2199623cd09bd8 Mon Sep 17 00:00:00 2001 From: Zhanibek Adilbekov Date: Sun, 30 Jan 2022 05:37:06 +0600 Subject: [PATCH 2/2] fix(out_es): update docs according to feature PR comments Signed-off-by: Zhanibek Adilbekov --- pipeline/outputs/elasticsearch.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pipeline/outputs/elasticsearch.md b/pipeline/outputs/elasticsearch.md index 2dc07e623..241388348 100644 --- a/pipeline/outputs/elasticsearch.md +++ b/pipeline/outputs/elasticsearch.md @@ -36,7 +36,7 @@ The **es** output plugin, allows to ingest your records into an [Elasticsearch]( | Tag\_Key | When Include\_Tag\_Key is enabled, this property defines the key name for the tag. | \_flb-key | | Generate\_ID | When enabled, generate `_id` for outgoing records. This prevents duplicate records when retrying ES. | Off | | Id\_Key | If set, `_id` will be the value of the key from incoming record and `Generate_ID` option is ignored. | | -| Write\_Operation | The write\_operation can be any of: index (default), create, update, upsert. | index | +| Write\_Operation | The write\_operation can be any of: create (default), index, update, upsert. | create | | Replace\_Dots | When enabled, replace field name dots with underscore, required by Elasticsearch 2.0-2.3. | Off | | Trace\_Output | When enabled print the elasticsearch API calls to stdout \(for diag only\) | Off | | Trace\_Error | When enabled print the elasticsearch API calls to stdout when elasticsearch returns an error \(for diag only\) | Off | @@ -56,12 +56,12 @@ The write\_operation can be any of: | Operation | Description | | ------------- | ----------- | -| index (default) | new data is added while existing data (based on its id) is replaced (reindexed).| -| create | adds new data - if the data already exists (based on its id), the op is skipped.| -| update | updates existing data (based on its id). If no data is found, the op is skipped.| -| upsert | known as merge or insert if the data does not exist, updates if the data exists (based on its id).| +| create (default) | adds new data - if the data already exists (based on its id), the op is skipped.| +| index | new data is added while existing data (based on its id) is replaced (reindexed).| +| update | updates existing data (based on its id). If no data is found, the op is skipped.| +| upsert | known as merge or insert if the data does not exist, updates if the data exists (based on its id).| -**Please note, id is required in create, update, and upsert scenario. Without id, the message will be dropped.** +**Please note, `Id_Key` or `Generate_ID` is required in update, and upsert scenario.** ## Getting Started