> For the complete documentation index, see [llms.txt](https://docs.fluentbit.io/manual/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fluentbit.io/manual/data-pipeline/outputs/datadog.md).

# Datadog

Send logs to Datadog

The *Datadog* output plugin lets you ingest your logs into [Datadog](https://www.datadoghq.com/).

Before you begin, you need a [Datadog account](https://app.datadoghq.com/signup), a [Datadog API key](https://docs.datadoghq.com/account_management/api-app-keys/), and you need to [activate Datadog Logs Management](https://app.datadoghq.com/account/login?next=%2Flogs%2Factivation).

## Configuration parameters

| Key               | Description                                                                                                                                                                                                                                                                                                               | Default                          |
| ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------- |
| `apikey`          | Your [Datadog API key](https://app.datadoghq.com/account/settings#api).                                                                                                                                                                                                                                                   | *none*                           |
| `compress`        | Compresses the payload in GZIP format. Datadog supports and recommends setting this to `gzip`.                                                                                                                                                                                                                            | `false`                          |
| `dd_hostname`     | The host the emitted logs should be associated with. If unset, Datadog expects the host to be set with `host`, `hostname`, or `syslog.hostname` attributes. See [Datadog Logs preprocessor documentation](https://docs.datadoghq.com/logs/log_configuration/pipelines/?tab=host#preprocessing) for recognized attributes. | *none*                           |
| `dd_message_key`  | By default, the plugin searches for the key `log` and remaps the value to the key `message`. If the property is set, the plugin searches for the property name key.                                                                                                                                                       | `log`                            |
| `dd_service`      | Recommended. The human readable name for your service generating the logs. For example, the name of your application or database. If not set, Datadog looks for the service using [service remapper](https://docs.datadoghq.com/logs/log_configuration/pipelines/?tab=service#service-attribute).                         | *none*                           |
| `dd_source`       | Recommended. A human-readable name for the underlying technology of your service like `postgres` or `nginx`. If unset, Datadog looks for the source in the [`ddsource` attribute](https://docs.datadoghq.com/logs/log_configuration/pipelines/?tab=source#source-attribute).                                              | *none*                           |
| `dd_tags`         | The [tags](https://docs.datadoghq.com/getting_started/tagging/) you want to assign to your logs in Datadog. If unset, Datadog looks for the tags in the [`ddtags` attribute](https://docs.datadoghq.com/api/latest/logs/#send-logs).                                                                                      | *none*                           |
| `header`          | Add additional arbitrary HTTP header key/value pair. Multiple headers can be set.                                                                                                                                                                                                                                         | *none*                           |
| `host`            | The Datadog server where you are sending your logs.                                                                                                                                                                                                                                                                       | `http-intake.logs.datadoghq.com` |
| `include_tag_key` | If enabled, a tag is appended to the output. The key name is used with the `tag_key` property.                                                                                                                                                                                                                            | `false`                          |
| `json_date_key`   | Date key name for output.                                                                                                                                                                                                                                                                                                 | `timestamp`                      |
| `provider`        | To activate remapping, specify the configuration flag provider with the value `ecs`.                                                                                                                                                                                                                                      | *none*                           |
| `proxy`           | Specifies an HTTP proxy. The expected format of this value is `http://host:port`. HTTPS isn't supported.                                                                                                                                                                                                                  | *none*                           |
| `tag_key`         | The key name of tag. If `include_tag_key` is `false`, this property is ignored.                                                                                                                                                                                                                                           | `tagkey`                         |
| `tls`             | End-to-end security communications protocol. Datadog recommends setting this to `on`.                                                                                                                                                                                                                                     | `off`                            |
| `workers`         | The number of [workers](/manual/administration/multithreading.md#outputs) to perform flush operations for this output.                                                                                                                                                                                                    | `0`                              |

### Configuration file

Get started with this configuration file:

{% tabs %}
{% tab title="fluent-bit.yaml" %}

```yaml
pipeline:

  outputs:
    - name: datadog
      match: '*'
      host: http-intake.logs.datadoghq.com
      tls: on
      compress: gzip
      apikey: <my-datadog-api-key>
      dd_service: <my-app-service>
      dd_source: <my-app-source>
      dd_tags: team:logs,foo:bar
      dd_hostname: myhost
```

{% endtab %}

{% tab title="fluent-bit.conf" %}

```
[OUTPUT]
  Name        datadog
  Match       *
  Host        http-intake.logs.datadoghq.com
  Tls         on
  Compress    gzip
  Apikey      <my-datadog-api-key>
  Dd_Service  <my-app-service>
  Dd_Source   <my-app-source>
  Dd_Tags     team:logs,foo:bar
  Dd_Hostname myhost
```

{% endtab %}
{% endtabs %}

## Troubleshooting

If you get a `403 Forbidden` error response, double check that you have a valid [Datadog API key](https://docs.datadoghq.com/account_management/api-app-keys/) and that you have [activated Datadog Logs Management](https://app.datadoghq.com/logs/activation).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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 following URL with the `ask` and `goal` query parameters:

```
GET https://docs.fluentbit.io/manual/data-pipeline/outputs/datadog.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `build a script that syncs our docs to a CMS` lets GitBook tailor the answer to that use case.

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.
