---
title: OpenSearch Destination
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > Observability Pipelines > Destinations > OpenSearch Destination
---

# OpenSearch Destination

{% callout %}
# Important note for users on the following Datadog sites: app.ddog-gov.com

{% alert level="danger" %}
This product is not supported for your selected [Datadog site](https://docs.datadoghq.com/getting_started/site). ().
{% /alert %}

{% /callout %}
Available for:
{% icon name="icon-logs" /%}
 Logs 
Use Observability Pipelines' OpenSearch destination to send logs to OpenSearch.

## Setup{% #setup %}

Set up the OpenSearch destination and its environment variables when you [set up a pipeline](https://app.datadoghq.com/observability-pipelines). The information below is configured in the pipelines UI.

### Set up the destination{% #set-up-the-destination %}

{% alert level="danger" %}
Only enter the identifiers for the OpenSearch endpoint URL, username, and password. Do not enter the actual values.
{% /alert %}

1. Enter the identifier for your OpenSearch endpoint URL. If you leave it blank, the default is used.
1. Enter the identifier for your OpenSearch username. If you leave it blank, the default is used.
1. Enter the identifier for your OpenSearch password. If you leave it blank, the default is used.
1. In the **Mode** dropdown menu, select **Bulk** or **Data streams**.
   - **Bulk** mode
     - Uses OpenSearch's [Bulk API](https://docs.opensearch.org/latest/api-reference/document-apis/bulk/) to send batched events directly into a standard index.
     - Choose this mode when you want direct control over index naming and lifecycle management. Data is appended to the index you specify, and you are responsible for handling rollovers, deletions, and mappings.
     - To configure **Bulk** mode:
       - In the **Index** field, optionally enter the name of the OpenSearch index. You can use [template syntax](https://docs.datadoghq.com/observability_pipelines/destinations/#template-syntax) to dynamically route logs to different indexes based on specific fields in your logs, for example `logs-{{service}}`.
   - **Data streams** mode
     - Uses [OpenSearch Data Streams](https://docs.opensearch.org/latest/im-plugin/data-streams/) for log storage. Data streams automatically manage backing indexes and rollovers, making them ideal for timeseries log data.
     - Choose this mode when you want OpenSearch to manage the index lifecycle for you. Data streams ensures smooth rollovers, Index Lifecycle Management (ILM) compatibility, and optimized handling of time-based data.
     - To configure **Data streams** mode, optionally define the data stream name (default is `logs-generic-default`) by entering the following information:
       - In the **Type** field, enter the category of data being ingested, for example `logs`.
       - In the **Dataset** field, specify the format or data source that describes the structure, for example `apache`.
       - In the **Namespace** field, enter the grouping for organizing your data streams, for example `production`.
       - In the UI, there is a preview of the data stream name you configured. With the above example inputs, the data stream name that the Worker writes to is `logs-apache-production`.

#### Optional settings{% #optional-settings %}

##### OpenSearch index{% #opensearch-index %}

Enter the name of the OpenSearch index. See [template syntax](https://docs.datadoghq.com/observability_pipelines/destinations/#template-syntax) if you want to route logs to different indexes based on specific fields in your logs.

##### Buffering{% #buffering %}

Toggle the switch to enable **Buffering Options**. Enable a configurable buffer on your destination to ensure intermittent latency or an outage at the destination doesn't create immediate backpressure, and allow events to continue to be ingested from your source. Disk buffers can also increase pipeline durability by writing data to disk, ensuring buffered data persists through a Worker restart. See [Destination buffers](https://docs.datadoghq.com/observability_pipelines/scaling_and_performance/buffering_and_backpressure/#destination-buffers) for more information.

- If left unconfigured, your destination uses a memory buffer with a capacity of 500 events.
- To configure a buffer on your destination:
  1. Select the buffer type you want to set (**Memory** or **Disk**).
  1. Enter the buffer size and select the unit.
     1. Maximum memory buffer size is 128 GB.
     1. Maximum disk buffer size is 500 GB.
  1. In the **Behavior on full buffer** dropdown menu, select whether you want to **block** events or **drop new events** when the buffer is full.

### Set secrets{% #set-secrets %}

These are the defaults used for secret identifiers and environment variables.

**Note**: If you enter secret identifiers and then choose to use environment variables, the environment variable is the identifier entered and prepended with `DD_OP`. For example, if you entered `PASSWORD_1` for a password identifier, the environment variable for that password is `DD_OP_PASSWORD_1`.

{% tab title="Secrets Management" %}

- OpenSearch endpoint URL identifier:
  - The default identifier is `DESTINATION_OPENSEARCH_ENDPOINT_URL`.
- OpenSearch authentication username identifier:
  - The default identifier is `DESTINATION_OPENSEARCH_USERNAME`.
- OpenSearch authentication password identifier:
  - The default identifier is `DESTINATION_OPENSEARCH_PASSWORD`.

{% /tab %}

{% tab title="Environment Variables" %}

- OpenSearch authentication username:
  - The default environment variable is `DD_OP_DESTINATION_OPENSEARCH_USERNAME`.
- OpenSearch authentication password:
  - The default environment variable is `DD_OP_DESTINATION_OPENSEARCH_PASSWORD`.
- OpenSearch endpoint URL:
  - The default environment variable is `DD_OP_DESTINATION_OPENSEARCH_ENDPOINT_URL`.

{% /tab %}

## How the destination works{% #how-the-destination-works %}

### Event batching{% #event-batching %}

A batch of events is flushed when one of these parameters is met. See [event batching](https://docs.datadoghq.com/observability_pipelines/destinations/#event-batching) for more information.

| Maximum Events | Maximum Size (MB) | Timeout (seconds) |
| -------------- | ----------------- | ----------------- |
| None           | 10                | 1                 |
