Fluent Bit is a lightweight log processor and forwarder.
It collects, parses, and routes logs to various destinations (stdout, Elasticsearch, Loki, S3, etc.).
flowchart LR
App([Application]) -->|logs| Volume[./logs]
Volume --> FB[Fluent Bit]
FB --> Stdout[stdout]
FB --> ES[Elasticsearch]
FB --> Loki[Loki]
FB --> S3[S3 / File]
Monitor([Monitor]) -->|:2020| FB
- Applications write log files to a shared volume.
- Fluent Bit tails log files using the
tailinput plugin. - Logs are parsed, filtered, and routed to configured outputs.
- The built-in HTTP server on port 2020 exposes health and metrics endpoints.
- Image:
fluent/fluent-bit:latest - Container name:
fluent-bit - Monitoring port:
2020 - Config mount:
./fluent-bit/fluent-bit.conf - Log input:
./logs(read-only)
Set via .env (copy from .env.example):
FLUENTBIT_PORT(default:2020)
From the repository root:
cd fluentbit
cp .env.example .env
mkdir -p logs
docker compose up -dGenerate test logs:
echo '{"time":"2026-05-21T10:00:00.000","level":"info","msg":"hello fluent-bit"}' >> logs/app.logCheck health:
curl http://localhost:2020/api/v1/healthView metrics:
curl http://localhost:2020/api/v1/metricsUseful commands:
docker compose ps
docker compose logs -f
docker compose restart
docker compose down- Edit
fluent-bit/fluent-bit.confto add outputs (Elasticsearch, Loki, S3, Kafka, etc.). - Use filters to enrich, modify, or drop log records before forwarding.
- Mount additional log paths from other containers using shared volumes.
- Pair with Prometheus to scrape the
/api/v1/metrics/prometheusendpoint.
- The default config outputs to stdout for quick testing — add real outputs for production use.
- Fluent Bit is extremely lightweight (~450KB) compared to Fluentd or Logstash.
- Place your application log files in
./logs/and they will be tailed automatically. - See Fluent Bit docs for full plugin and configuration reference.