Fluentbit

来自Gea-Suan Lin's Wiki
跳到导航 跳到搜索

Fluentbit是一套Log處理軟體,以佔用資源最佳化。

簡介

我是拿來跑client端(發送端)而非server端(接收端)。

安裝

Ubuntu上安裝:

wget -qO - https://packages.fluentbit.io/fluentbit.key | sudo apt-key add -; echo "deb 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

相關連結

外部連結