Fluentbit
Fluentbit是一套Log处理软件,以占用资源最佳化。
简介
我是拿来跑client端(发送端)而非server端(接收端)。
安装
在Ubuntu上安装:
curl https://packages.fluentbit.io/fluentbit.key | gpg --dearmor | tee /usr/share/keyrings/fluentbit-keyring.gpg; echo "deb [signed-by=/usr/share/keyrings/fluentbit-keyring.gpg] https://packages.fluentbit.io/ubuntu/$(lsb_release -cs) $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/fluentbit.list; sudo apt update; sudo apt install -y td-agent-bit; sudo apt clean
设定
在/etc/td-agent-bit/td-agent-bit.conf
内的设定,这边沿用了本来的预设值:
[SERVICE]
flush 5
daemon off
log_level info
parsers_file parsers.conf
plugins_file plugins.conf
http_server off
http_listen 0.0.0.0
http_port 2020
storage.metrics on
[INPUT]
name tail
path /var/log/*.log
[OUTPUT]
name http
http_User user
http_Passwd abcdefghijklmnopqrstuvwx
host fluent.example.com
port 443
tls on
uri /
format json
接着是让他开机启动:
sudo systemctl enable td-agent-bit; sudo service td-agent-bit restart
相关连结
外部链接
- 官方网站 (英文)