> 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/treasure-data.md).

# Treasure Data

The *Treasure Data* (TD) output plugin lets you flush your records into the [Treasure Data](https://www.treasure.ai/) cloud service.

## Configuration parameters

The plugin supports the following configuration parameters:

| Key        | Description                                                                                                                                                     | Default |
| ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- |
| `api`      | The Treasure Data API key. To obtain it, log into the [Console](https://console.treasuredata.com/users/sign_in) and in the API keys box, copy the API key hash. | *none*  |
| `database` | Specify the name of your target database.                                                                                                                       | *none*  |
| `region`   | Set the service region. Allowed values: `US`, `JP`.                                                                                                             | `US`    |
| `Region`   | Classic-mode spelling of `region`. Allowed values: `us`, `jp`.                                                                                                  | `US`    |
| `table`    | Specify the name of your target table where the records will be stored.                                                                                         | *none*  |
| `workers`  | The number of [workers](/manual/administration/multithreading.md#outputs) to perform flush operations for this output.                                          | `0`     |

## Get started

To start inserting records into Treasure Data, run the plugin from the command line or through the configuration file.

### Command line

You can run the plugin from the command line, but it exposes your API key. Using a configuration file is recommended.

```shell
fluent-bit -i cpu -o td -p API="abc" -p Database="fluentbit" -p Table="cpu_samples"
```

### Configuration file

In your main configuration file append the following:

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

```yaml
pipeline:
  inputs:
    - name: cpu
      tag: my_cpu

  outputs:
    - name: td
      match: '*'
      api: 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX'
      database: fluentbit
      table: cpu_samples
```

{% endtab %}

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

```
[INPUT]
  Name cpu
  Tag  my_cpu

[OUTPUT]
  Name     td
  Match    *
  API      XXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  Database fluentbit
  Table    cpu_samples
```

{% endtab %}
{% endtabs %}


---

# 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 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/treasure-data.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 `automate deployments from our CI pipeline` 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.
