Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 79 additions & 70 deletions pipeline/outputs/elasticsearch.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,43 +12,46 @@

| Key | Description | Default |
| :--- | :--- | :--- |
| Host | IP address or hostname of the target Elasticsearch instance | 127.0.0.1 |
| Port | TCP port of the target Elasticsearch instance | 9200 |
| Path | Elasticsearch accepts new data on HTTP query path "/\_bulk". But it is also possible to serve Elasticsearch behind a reverse proxy on a subpath. This option defines such path on the fluent-bit side. It simply adds a path prefix in the indexing HTTP POST URI. | Empty string |
| compress | Set payload compression mechanism. Option available is 'gzip' | |
| Buffer\_Size | Specify the buffer size used to read the response from the Elasticsearch HTTP service. This option is useful for debugging purposes where is required to read full responses, note that response size grows depending of the number of records inserted. To set an _unlimited_ amount of memory set this value to **False**, otherwise the value must be according to the [Unit Size](../../administration/configuring-fluent-bit/unit-sizes.md) specification. | 512KB |
| Pipeline | Newer versions of Elasticsearch allows to setup filters called pipelines. This option allows to define which pipeline the database should use. For performance reasons is strongly suggested to do parsing and filtering on Fluent Bit side, avoid pipelines. | |
| AWS\_Auth | Enable AWS Sigv4 Authentication for Amazon OpenSearch Service | Off |
| AWS\_Region | Specify the AWS region for Amazon OpenSearch Service | |
| AWS\_STS\_Endpoint | Specify the custom sts endpoint to be used with STS API for Amazon OpenSearch Service | |
| AWS\_Role\_ARN | AWS IAM Role to assume to put records to your Amazon cluster | |
| AWS\_External\_ID | External ID for the AWS IAM Role specified with `aws_role_arn` | |
| AWS\_Service\_Name | Service name to be used in AWS Sigv4 signature. For integration with Amazon OpenSearch Serverless, set to `aoss`. See the [FAQ](opensearch.md#faq) section on Amazon OpenSearch Serverless for more information. | es |
| Cloud\_ID | If you are using Elastic's Elasticsearch Service you can specify the cloud\_id of the cluster running. The Cloud ID string has the format `<deployment_name>:<base64_info>`. Once decoded, the `base64_info` string has the format `<deployment_region>$<elasticsearch_hostname>$<kibana_hostname>`.
| |
| Cloud\_Auth | Specify the credentials that would be used to connect to Elastic's Elasticsearch Service running on Elastic Cloud | |
| Cloud\_Apikey | Specify the ApiKey that would be used to connect to Elastic's Elasticsearch Service running on Elastic Cloud | |
| HTTP\_User | Optional username credential for Elastic X-Pack access | |
| HTTP\_Passwd | Password for user defined in HTTP\_User | |
| Index | Index name | fluent-bit |
| Type | Type name | \_doc |
| Logstash\_Format | Enable Logstash format compatibility. This option takes a boolean value: True/False, On/Off | Off |
| Logstash\_Prefix | When Logstash\_Format is enabled, the Index name is composed using a prefix and the date, e.g: If Logstash\_Prefix is equals to 'mydata' your index will become 'mydata-YYYY.MM.DD'. The last string appended belongs to the date when the data is being generated. | logstash |
| Logstash\_Prefix\_Key | When included: the value of the key in the record will be evaluated as key reference and overrides Logstash\_Prefix for index generation. If the key/value is not found in the record then the Logstash\_Prefix option will act as a fallback. The parameter is expected to be a [record accessor](../../administration/configuring-fluent-bit/classic-mode/record-accessor.md). | |
| Logstash\_Prefix\_Separator | Set a separator between logstash_prefix and date.| - |
| Logstash\_DateFormat | Time format \(based on [strftime](http://man7.org/linux/man-pages/man3/strftime.3.html)\) to generate the second part of the Index name. | %Y.%m.%d |
| Time\_Key | When Logstash\_Format is enabled, each record will get a new timestamp field. The Time\_Key property defines the name of that field. | @timestamp |
| Time\_Key\_Format | When Logstash\_Format is enabled, this property defines the format of the timestamp. | %Y-%m-%dT%H:%M:%S |
| Time\_Key\_Nanos | When Logstash\_Format is enabled, enabling this property sends nanosecond precision timestamps. | Off |
| Include\_Tag\_Key | When enabled, it append the Tag name to the record. | Off |
| 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: 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 | Print all elasticsearch API request payloads to stdout \(for diag only\) | Off |
| Trace\_Error | If elasticsearch return an error, print the elasticsearch API request and response \(for diag only\) | Off |
| Current\_Time\_Index | Use current time for index generation instead of message record | Off |
| `Host` | IP address or hostname of the target Elasticsearch instance | `127.0.0.1` |
| `Port` | TCP port of the target Elasticsearch instance | `9200` |
| `Path` | Elasticsearch accepts new data on HTTP query path `/_bulk`. You can also serve Elasticsearch behind a reverse proxy on a sub-path. Define the path by adding a path prefix in the indexing HTTP POST URI. | Empty string |
| `compress` | Set payload compression mechanism. Option available is `gzip`. | _none_ |
| `Buffer_Size` | Specify the buffer size used to read the response from the Elasticsearch HTTP service. Use for debugging purposes where required to read full responses. Response size grows depending of the number of records inserted. To use an unlimited amount of memory, set this value to `False`. Otherwise set the value according to the [Unit Size](../../administration/configuring-fluent-bit/unit-sizes.md). | `512KB` |
| `Pipeline` | Define which pipeline the database should use. For performance reasons, it's strongly suggested to do parsing and filtering on Fluent Bit side, and avoid pipelines. | _none_ |
| `AWS_Auth` | Enable AWS Sigv4 Authentication for Amazon OpenSearch Service. | `Off` |
| `AWS_Region` | Specify the AWS region for Amazon OpenSearch Service. | _none_ |
| `AWS_STS_Endpoint` | Specify the custom STS endpoint to be used with STS API for Amazon OpenSearch Service | _none_ |
| `AWS_Role_ARN` | AWS IAM Role to assume to put records to your Amazon cluster | _none_ |
| `AWS_External_ID` | External ID for the AWS IAM Role specified with `aws_role_arn` | _none_ |
| `AWS_Service_Name` | Service name to use in AWS Sigv4 signature. For integration with Amazon OpenSearch Serverless, set to `aoss`. See [Amazon OpenSearch Serverless](opensearch.md) for more information. | `es` |
| `AWS_Profile` | AWS profile name | `default` |
| `Cloud_ID` | If using Elastic's Elasticsearch Service you can specify the `cloud_id` of the cluster running. The string has the format `<deployment_name>:<base64_info>`. Once decoded, the `base64_info` string has the format `<deployment_region>$<elasticsearch_hostname>$<kibana_hostname>`. | _none_ |
| `Cloud_Auth` | Specify the credentials to use to connect to Elastic's Elasticsearch Service running on Elastic Cloud. | _none_ |
| `Cloud_Apikey` | Specify the APi key to used to connect to Elastic's Elasticsearch Service running on Elastic Cloud. | _none_ |

Check warning on line 30 in pipeline/outputs/elasticsearch.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Spelling] Spelling check: 'APi'? Raw Output: {"message": "[FluentBit.Spelling] Spelling check: 'APi'?", "location": {"path": "pipeline/outputs/elasticsearch.md", "range": {"start": {"line": 30, "column": 32}}}, "severity": "INFO"}
| `HTTP_User` | Optional username credential for Elastic X-Pack access | _none_ |
| `HTTP_Passwd` | Password for user defined in `HTTP_User` | _none_ |
| `HTTP_API_Key` | API key for authenticating with Elasticsearch. Must be `base64` encoded. If `HTTP_User` or `Cloud_Auth` are defined, this parameter is ignored. | _none_ |
| `Index` | Index name | `fluent-bit` |
| `Type` | Type name | `_doc` |
| `Logstash_Format` | Enable Logstash format compatibility. This option takes a Boolean value: `True/False`, `On/Off` | `Off` |
| `Logstash_Prefix` | When `Logstash_Format` is enabled, the Index name is composed using a prefix and the date, e.g: If `Logstash_Prefix` is equal to `mydata` your index will become `mydata-YYYY.MM.DD`. The last string appended belongs to the date when the data is being generated. | `logstash` |
| `Logstash_Prefix_Key` | When included: the value of the key in the record will be evaluated as key reference and overrides `Logstash_Prefix` for index generation. If the key/value isn't found in the record then the `Logstash_Prefix` option will act as a fallback. The parameter is expected to be a [record accessor](../../administration/configuring-fluent-bit/classic-mode/record-accessor.md). | _none_ |
| `Logstash_Prefix_Separator` | Set a separator between `Logstash_Prefix` and date.| `-` |
| `Logstash_DateFormat` | Time format based on [strftime](http://man7.org/linux/man-pages/man3/strftime.3.html) to generate the second part of the Index name. | `%Y.%m.%d` |
| `Time_Key` | When `Logstash_Format` is enabled, each record will get a new timestamp field. The `Time_Key` property defines the name of that field. | `@timestamp` |
| `Time_Key_Format` | When `Logstash_Format` is enabled, this property defines the format of the timestamp. | `%Y-%m-%dT%H:%M:%S` |
| `Time_Key_Nanos` | When `Logstash_Format` is enabled, enabling this property sends nanosecond precision timestamps. | `Off` |
| `Include_Tag_Key` | When enabled, it append the Tag name to the record. | `Off` |
| `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. | _none_ |
| `Write_Operation` | `Write_operation` can be any of: `create`, `index`, `update`, `upsert`. | `create` |
| `Replace_Dots` | When enabled, replace field name dots with underscore. Required by Elasticsearch 2.0-2.3. | `Off` |
| `Trace_Output` | Print all ElasticSearch API request payloads to `stdout` for diagnostics. | `Off` |
| `Trace_Error` | If ElasticSearch returns an error, print the ElasticSearch API request and response for diagnostics. | `Off` |
| `Current_Time_Index` | Use current time for index generation instead of message record. | `Off` |
| `Suppress_Type_Name` | When enabled, mapping types is removed and `Type` option is ignored. Elasticsearch 8.0.0 or higher [no longer supports mapping types](https://www.elastic.co/guide/en/elasticsearch/reference/current/removal-of-types.html), and is set to `On`. | `Off` |
| `Workers` | The number of [workers](../../administration/multithreading.md#outputs) to perform flush operations for this output. | `2` |

If you have used a common relational database, the parameters `index` and `type` can be compared to the `database` and `table` concepts.

Expand Down Expand Up @@ -207,11 +210,8 @@
tls On
```

Fluent Bit supports connecting to [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) by providing `cloud_id` setting and the proper credentials. Credentials can be specified by either the `cloud_auth` or `cloud_apikey` setting.

`cloud_auth` uses the `elastic` user and password provided when the cluster was created. For details refer to the [Cloud ID usage page](https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html).

`cloud_apikey` uses the cloud apikey that could be generated in the Elasticsearch Service console. For details, refer to the [Cloud API Keys page](https://www.elastic.co/guide/en/cloud/current/ec-api-keys.html).
{% endtab %}
{% endtabs %}

Be aware that the `Port` is set to `443`, `tls` is enabled, and `AWS_Region` is set.

Expand All @@ -220,26 +220,20 @@
Fluent Bit supports connecting to [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) by providing the `cloud_id` and the `cloud_auth` settings. `cloud_auth` uses the `elastic` user and password provided when the cluster was created. For details refer to the [Cloud ID usage page](https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html).
Example configuration:

```text
[OUTPUT]
Name es
Include_Tag_Key true
Tag_Key tags
tls On
tls.verify Off
Suppress_Type_Name On
cloud_id elastic-obs-deployment:ZXVybxxxxxxxxxxxg==
cloud_auth elastic:2vxxxxxxxxYV
{% tabs %}
{% tab title="fluent-bit.yaml" %}

[OUTPUT]
Name es
Include_Tag_Key true
Tag_Key tags
tls On
tls.verify Off
Suppress_Type_Name On
cloud_id elastic-obs-deployment:ZXVybxxxxxxxxxxxg==
cloud_apikey VnVhQxxxxxxxxxxxxx==
```yaml
pipeline:

outputs:
- name: es
include_tag_key: true
tag_key: tags
tls: on
tls.verify: off
cloud_id: 'elastic-obs-deployment:ZXVybxxxxxxxxxxxg=='
cloud_auth: 'elastic:2vxxxxxxxxYV'
```

{% endtab %}
Expand Down Expand Up @@ -323,6 +317,12 @@

For details, read [the official blog post on that issue](https://www.elastic.co/guide/en/elasticsearch/reference/6.7/removal-of-types.html).

Fluent Bit supports connecting to [Elastic Cloud](https://www.elastic.co/guide/en/cloud/current/ec-getting-started.html) by providing `cloud_id` setting and the proper credentials. Credentials can be specified by either the `cloud_auth` or `cloud_apikey` setting.

`cloud_auth` uses the `elastic` user and password provided when the cluster was created. For details refer to the [Cloud ID usage page](https://www.elastic.co/guide/en/cloud/current/ec-cloud-id.html).

`cloud_apikey` uses the cloud apikey that could be generated in the Elasticsearch Service console. For details, refer to the [Cloud API Keys page](https://www.elastic.co/guide/en/cloud/current/ec-api-keys.html).

Check warning on line 324 in pipeline/outputs/elasticsearch.md

View workflow job for this annotation

GitHub Actions / runner / vale

[vale] reported by reviewdog 🐶 [FluentBit.Spelling] Spelling check: 'apikey'? Raw Output: {"message": "[FluentBit.Spelling] Spelling check: 'apikey'?", "location": {"path": "pipeline/outputs/elasticsearch.md", "range": {"start": {"line": 324, "column": 8}}}, "severity": "INFO"}

### Mapping type names can't start with underscores (`_`)

Fluent Bit v1.5 changed the default mapping type from `flb_type` to `_doc`, matching the recommendation from Elasticsearch for version 6.2 and greater ([see commit with rationale](https://github.com/fluent/fluent-bit/commit/04ed3d8104ca8a2f491453777ae6e38e5377817e#diff-c9ae115d3acaceac5efb949edbb21196)).
Expand Down Expand Up @@ -354,15 +354,24 @@

```text
[OUTPUT]
Name es
Match *
Host vpc-test-domain-ke7thhzoo7jawsrhmm6mb7ite7y.us-west-2.es.amazonaws.com
Port 443
Index my_index
AWS_Auth On
AWS_Region us-west-2
tls On
Type doc
Name es
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Spacing for configuration files should indent 2, not 4.

Include_Tag_Key true
Tag_Key tags
tls On
tls.verify Off
Suppress_Type_Name On
cloud_id elastic-obs-deployment:ZXVybxxxxxxxxxxxg==
cloud_auth elastic:2vxxxxxxxxYV

Name es
Match *
Host vpc-test-domain-ke7thhzoo7jawsrhmm6mb7ite7y.us-west-2.es.amazonaws.com
Port 443
Index my_index
AWS_Auth On
AWS_Region us-west-2
tls On
Type doc
```

{% endtab %}
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.