📤
Monitoring & Observability

Fluentd

Unified log collector — route logs to Elasticsearch, S3, Kafka, and more

🐧 Linux🍎 Mac🪟 Windows
Reviewed: Tested on: Kubernetes 1.29 · Terraform 1.8 · Ubuntu 22.04

What is this?

Fluentd collects logs from servers and apps and forwards them to Elasticsearch, S3, or Kafka.

📥

Step 01

Install Fluentd

(01)Install Fluentd

Linux
1curl -fsSL https://toolbelt.treasuredata.com/sh/install-ubuntu-focal-td-agent4.sh | sudo sh
⚙️

Step 02

Configure Fluentd

(01)Configure Fluentd

Linux
1sudo tee /etc/td-agent/td-agent.conf << 'EOF'
2<source>
3 @type tail
4 path /var/log/syslog
5 pos_file /var/log/td-agent/syslog.pos
6 tag system.syslog
7 format none
8</source>
9<match system.**>
10 @type stdout
11</match>
12EOF
13sudo systemctl restart td-agent

Step 03

Verify

(01)Verify installation

Linux
1sudo systemctl status td-agent
2sudo tail -f /var/log/td-agent/td-agent.log
🔧

Step 04

Common Problems

#1Fluentd not collecting logs

Linux
1sudo systemctl status td-agent
2sudo tail -f /var/log/td-agent/td-agent.log
3sudo td-agent --config-test -c /etc/td-agent/td-agent.conf