Skip to content

Installing Fluentd on macOS

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.

fluent-package for macOS is planned to be available via Homebrew in the future. For current installation options, see the Fluentd Installation Guide.

For production environments, we recommend using Linux-based systems (Ubuntu, Debian, RHEL, or Amazon Linux).

Alternative: Install Fluentd via Ruby Gem

For development and testing on macOS, you can install Fluentd using Ruby gems:

# Install Fluentd
gem install fluentd

# Install the TD plugin for Treasure Data integration
gem install fluent-plugin-td

# Create a sample configuration file
fluentd --setup ./fluent

# Start Fluentd
fluentd -c ./fluent/fluent.conf

Configuration

Your configuration file should include the TD output plugin for sending data to Treasure Data:

# Input from HTTP
<source>
  @type http
  port 8888
</source>

# Treasure Data Output
<match td.*.*>
  @type tdlog
  endpoint api.treasuredata.com
  apikey YOUR_API_KEY
  auto_create_table
  use_ssl true
  <buffer>
    @type file
    path ./fluent/buffer/td
  </buffer>
</match>

Post Sample Logs using HTTP

By default, with an HTTP input configured, you can post sample log records using the following curl command:

curl -X POST -d 'json={"json":"message"}' http://localhost:8888/debug.test

Other Resources