# Elasticsearch (Legacy)

### Description

The Elasticsearch (Legacy) Destination configures the [Elasticsearch exporter](https://github.com/open-telemetry/opentelemetry-collector-contrib/blob/main/exporter/elasticsearchexporter/README.md) to send telemetry data (logs, metric, traces) to Elastic for ingestion. If your Elastic deployment has the APM Server Integration, using the [Elasticsearch (OTLP) Destination](https://docs.bindplane.com/integrations/destinations/elasticsearch-otlp) is recommended as described below.

### Supported Types

| Metrics | Logs | Traces |
| ------- | ---- | ------ |
|         | ✓    | ✓      |

### Elasticsearch Exporter vs OTLP Exporter

{% hint style="info" %}
**NOTE**

Per [Elastic Documentation](https://www.elastic.co/guide/en/observability/current/apm-open-telemetry-direct.html#apm-connect-open-telemetry-collector):

"When using the OpenTelemetry Collector, you should always prefer sending data via the OTLP exporter to an Elastic APM Server. Other methods, like using the elasticsearch exporter to send data directly to Elasticsearch will send data to the Elastic Stack, but will bypass all of the validation and data processing that the APM Server performs. In addition, your data will not be viewable in the Kibana Observability apps if you use the elasticsearch exporter."
{% endhint %}

### Configuration Table

| Parameter                   | Type                | Default                | Description                                                                                                |
| --------------------------- | ------------------- | ---------------------- | ---------------------------------------------------------------------------------------------------------- |
| telemetry\_types            | `telemetrySelector` | Logs, Traces           | Specifies which types of telemetry to export to Elasticsearch.                                             |
| enable\_elastic\_cloud      | `bool`              | false                  | Whether or not to enable support for Elastic Cloud.                                                        |
| endpoints                   | `strings`           |                        | List of Elasticsearch URLs. e.g `https://elastic.corp.net:9200`.                                           |
| cloudid                     | `string`            |                        | The ID of the Elastic Cloud Cluster to publish events to. The cloudid can be used instead of endpoints.    |
| logs\_index                 | `string`            | logs-generic-default   | The index or datastream name to publish logs to.                                                           |
| traces\_index               | `string`            | traces-generic-default | The index or datastream name to publish traces to.                                                         |
| pipeline                    | `string`            |                        | Optional Ingest Node pipeline ID used for processing documents published by the exporter.                  |
| enable\_auth                | `bool`              | false                  | Whether or not to enable authentication.                                                                   |
| auth\_type                  | `enum`              | basic                  | Authentication Type to use. Options include "basic" and "apikey".                                          |
| user                        | `string`            |                        | Username used for HTTP Basic Authentication.                                                               |
| password                    | `string`            |                        | Password used for HTTP Basic Authentication.                                                               |
| api\_key                    | `string`            |                        | Authorization API Key.                                                                                     |
| configure\_tls              | `bool`              | false                  | Configure advanced TLS settings.                                                                           |
| insecure\_skip\_verify      | `bool`              | false                  | Enable to skip TLS certificate verification.                                                               |
| ca\_file                    | `string`            |                        | Certificate authority used to validate the database server's TLS certificate.                              |
| mutual\_tls                 | `bool`              | false                  | Whether or not to use mutual TLS authentication.                                                           |
| cert\_file                  | `string`            |                        | A TLS certificate used for client authentication if mutual TLS is enabled.                                 |
| key\_file                   | `string`            |                        | A TLS private key used for client authentication if mutual TLS is enabled.                                 |
| retry\_on\_failure\_enabled | `bool`              | true                   | Attempt to resend telemetry data that has failed to be transmitted to the destination.                     |
| num\_workers                | `int`               | 0                      | The number of workers publishing bulk requests concurrently. If 0, it defaults to the number of CPU cores. |

### Supported Retry and Queuing Settings

This destination supports the [retry settings](https://docs.bindplane.com/configuration/bindplane-otel-collector/retry-on-failure), the [sending queue settings](https://docs.bindplane.com/configuration/bindplane-otel-collector/sending-queue), and the [persistent queue settings.](https://docs.bindplane.com/configuration/bindplane-otel-collector/persistent-queue)

| Sending Queue | Persistent Queue | Retry on Failure |
| ------------- | ---------------- | ---------------- |
| ✓             | ✓                | \*               |

\* This destination only partially supports Retry on Failure; See the above configuration table for specific configuration for this destination type.

### Example Configuration

**Web Interface**

<figure><img src="https://1405008107-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FgmiOMzBfoNFwmKJFHMcJ%2Fuploads%2Fgit-blob-169cca3483a68197afa6318ea3e5c775b6d782be%2Fintegrations-destinations-elasticsearch-legacy-image-1.png?alt=media" alt="Bindplane docs - Elasticsearch Legacy - image 1"><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.bindplane.com/integrations/destinations/elasticsearch-legacy.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
