Skip to content

Setting Up Fluentd

td-agent was discontinued in December 2023 and has been replaced by fluent-package. The fluent-package is the official successor maintained by the Cloud Native Computing Foundation.

After installing fluent-package, you can modify your config file. The file can be found at /etc/fluent/fluentd.conf.

The config file comes with some sample settings. Specify your API key by setting the apikey option. You can view your API key from the TD Console.

# HTTP input
<source>
  @type http
  port 8888
</source>

# Treasure Data output
<match td.*.*>
  @type tdlog
  endpoint api-import.treasuredata.com
  apikey YOUR_API_KEY
  auto_create_table
  use_ssl true
  num_threads 8

  <buffer>
    @type file
    path /var/log/fluent/buffer/td
  </buffer>
</match>

YOUR_API_KEY should be your actual apikey string. You can retrieve your API key from your profiles in TD Console. Using a write-only API key is recommended.

Restart the Fluentd Service

# Linux (systemd)
sudo systemctl restart fluentd.service

Other Resources