# 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](https://www.cncf.io/projects/).

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 Treasure Console.


```conf
# 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 Treasure Console. Using a [write-only API key](/products/my-settings/getting-your-api-keys) is recommended.

## Restart the Fluentd Service


```bash
# Linux (systemd)
sudo systemctl restart fluentd.service
```

## Other Resources

- [Fluentd Documentation](https://docs.fluentd.org/)