Skip to main content

Fluent Bit Client

Fluent Bit is an open-source and multi-platform log processor tool that aims to be a generic Swiss knife for logs processing and distribution.

Fluent Bit works as a logging pipeline chunked into logical parts like Inputs, Parsers, Filters and Outputs. Kafka client implementation able in Output part. It means Fluent bit produces records and sends to Kafka.

Full Kafka plugin documentation can be found here

The Fluent Bit Kafka plugin is built on top of libdrkafka library.


Following are the steps for Fluent Bit installation on Ubuntu OS. The below steps will show how to build and install Fluent Bit with correct plugins and modules.


Building Fluent Bit from scratch requires installing git and then cloning a repository from GitHub and checkout to the latest version.

sudo apt update
sudo apt install git
git clone
git checkout 1.8.0-pack-fixes

Building of Fluent Bit requires other Ubuntu packages. Fluent Bit uses CMake as it build system. The suggested procedure to prepare the build system consists on the following steps:

sudo apt install -y build-essential
sudo apt install -y make
sudo apt install -y cmake
sudo apt install -y libsasl2-dev
sudo apt install -y bison
sudo apt install -y flex
sudo apt install -y libssl-dev


Change to the build directory inside the Fluent Bit sources and let CMake configure the project specifying where the root path is located with Kafka plugin and TLS module:

cd fluent-bit/build


This sample uses on input dummy plugin. It generates records that consists event time. Here is an example {"@timestamp":1629229398.754061,"message":"dummy"}. Output parameter uses kafka plugin with name of Kafka topic and additional parameters from libdrkafka library. A topic should have prefix of global either local namespace. A full topic name: <c8globals or c8locals>.<my-topic>.

bin/fluent-bit \
-i dummy \
-o kafka \
-p brokers=<my-gdn>.<my-paas> \
-p topics=<c8globals or c8locals>.<my-topic> \
-p \
-p rdkafka.enable.ssl.certificate.verification=false \
-p<path-to-ca.cert.pem-file> \
-p rdkafka.sasl.mechanism=PLAIN \
-p rdkafka.sasl.username=<my-tenant>/<my-fabric> \
-p rdkafka.sasl.password=token:<my-api-key or my-JWT> \
-p \
-p rdkafka.log.connection.close=false \
-p rdkafka.request.required.acks=1

Note: The full list of properties can be found here.


Sent messages can be verified by the consumer of any java, python, node.js Kafka client.

Example in nodejs

const consumer = kafka.consumer({ groupId: '<my-group-id>' })

await consumer.connect()
await consumer.subscribe({ topic: '<c8globals or c8locals>.<my-topic>', fromBeginning: true })

eachMessage: async ({ topic, partition, message }) => {
value: message.value.toString(),