Fluent Bit is a lightweight and efficient data processor and forwarder for logs, metrics, and traces. It’s widely used to aggregate and ship data to various endpoints like Elasticsearch, OpenObserve, and many others.
This tutorial demonstrates how to install Fluent Bit on Ubuntu 24.04.
Install Fluent Bit
Download the GPG key and add it to the specified directory:
sudo wget -qO /etc/apt/keyrings/fluentbit.asc https://packages.fluentbit.io/fluentbit.key
Add the Fluent Bit repository:
echo "deb [signed-by=/etc/apt/keyrings/fluentbit.asc] https://packages.fluentbit.io/ubuntu/$(lsb_release -sc) $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/fluentbit.list
Update the package lists and install Fluent Bit:
sudo apt update
sudo apt install -y fluent-bit
Start Fluent Bit service:
sudo service fluent-bit start
Run the following command to enable Fluent Bit to start automatically on boot:
sudo systemctl enable fluent-bit
We can check the Fluent Bit version using the following command:
/opt/fluent-bit/bin/fluent-bit --version
Use the following command to check if the Fluent Bit service is running:
sudo service fluent-bit status
Additionally, we can stop or restart the Fluent Bit service:
sudo service fluent-bit stop
sudo service fluent-bit restart
Testing Fluent Bit
By default, Fluent Bit is configured to collect CPU usage metrics and send the records to the standard output (stdout). We can view the output data using the journalctl
command:
journalctl -u fluent-bit -f
Uninstall Fluent Bit
Disable Fluent Bit service:
sudo systemctl disable fluent-bit
sudo systemctl daemon-reload
sudo systemctl reset-failed
Remove Fluent Bit and related dependencies:
sudo apt purge --autoremove -y fluent-bit
Remove GPG key and repository:
sudo rm -rf /etc/apt/keyrings/fluentbit.asc
sudo rm -rf /etc/apt/sources.list.d/fluentbit.list
Leave a Comment
Cancel reply