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:
td-agent-gem install fluent-plugin-logtail
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
<match *>
@type logtail
@id output_logtail
source_token YOUR_LOGTAIL_SOURCE_TOKEN
flush_interval 2 # in seconds
</match>
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:
sudo systemctl restart td-agent.service
You should start seeing your logs in Logtail πŸŽ‰
Copy link