Fluentd
Forward your logs to Logtail with Fluentd.
Setting up Fluentd is very straightforward:
  1. 1.
    Install Fluentd on your server according to the documentation.
  2. 2.
    Install and set up Fluentd input plugins to suit your needs (e.g., Syslog).
  3. 3.
    Install the Logtail plugin:
1
td-agent-gem install fluent-plugin-logtail
Copied!
Depending on how you're using Fluentd, you might have to install the plugin gem using fluent-gem instead of td-agent-gem. Read more about Plugin Management in the Fluentd documentation.
4. Modify the Fluentd configuration to start sending the logs to your Logtail source. A basic configuration that forwards logs from all inputs to a single Logtail source could look like this:
/etc/td-agent/td-agent.conf
1
<match *>
2
@type logtail
3
@id output_logtail
4
source_token YOUR_LOGTAIL_SOURCE_TOKEN
5
flush_interval 2 # in seconds
6
</match>
Copied!
Make sure you replace YOUR_LOGTAIL_SOURCE_TOKEN with your own source token from Logtail.com.
5. Once you're happy with your configuration, restart the Fluentd service:
1
sudo systemctl restart td-agent.service
Copied!
You should start seeing your logs in Logtail πŸŽ‰
Last modified 7mo ago
Copy link