Fluent Bit Config Generator

Generate production-ready Fluent Bit configurations with inputs, filters, outputs, parsers, and TLS.

Fluent Bit Settings

Inputs (1)

Filters (0)

Outputs (1)

fluent-bit.conf
Valid
1[SERVICE]
2 Flush 5
3 Log_Level info
4 Daemon Off
5 Parsers_File parsers.conf
6 HTTP_Server On
7 HTTP_Listen 127.0.0.1
8 HTTP_Port 2020
9 Health_Check On
10
11[INPUT]
12 Name tail
13 Tag var.log.*
14 Path /var/log/containers/*.log
15 Parser cri
16 DB /var/log/flb_kube.db
17 DB.lock true
18 Refresh_Interval 10
19 Mem_Buf_Limit 16MB
20 Skip_Long_Lines On
21
22[OUTPUT]
23 Name stdout
24 Match *
25 Format json_lines
26 Flush_interval 5
27 Retry_Limit 5
88
Overall Score

Configuration Health

Configuration needs improvements. Address warnings below for production readiness.

Detailed Analysis

Best Practice Analysis

  • Use Fluent Bit as a DaemonSet in Kubernetes to collect logs from every node.
  • Enable the HTTP server for Prometheus metrics and health check monitoring.
  • Configure DB files on tail inputs to prevent duplicate logs after restarts.
  • Set Mem_Buf_Limit to 16MB+ to handle burst traffic without dropping logs.
  • Enable TLS on all outputs forwarding logs over networks.

Production Readiness

  • Input Sources Configured
  • Output Destinations Configured
  • TLS Encryption Enabled
  • HTTP Metrics Server
  • Health Check Enabled
  • Offset Tracking (DB)

Overview

The Fluent Bit Config Generator produces production-ready Fluent Bit configurations for lightweight, high-performance log collection. Fluent Bit is an open-source log processor and forwarder part of the Fluentd ecosystem, written in C with a minimal memory footprint (~1MB) making it ideal for edge deployments, Kubernetes DaemonSets, and resource-constrained environments.

Fluent Bit uses an INI-style configuration file with [SERVICE], [INPUT], [FILTER], [OUTPUT], and [PARSER] sections. This generator abstracts the syntax complexities, letting you visually configure inputs, filters, outputs, parsers, TLS, and buffering to produce a perfectly valid configuration.

How It Works

1. Service Configuration: Defines global settings like flush interval, log level, daemon mode, and the path to parsers files. The HTTP server enables Prometheus-compatible metrics at port 2020.

2. Define Inputs: Inputs specify where logs come from. Use tail for files, forward for network forwarding, systemd for journal logs, docker for container logs, kube for Kubernetes metadata enrichment, or tcp/udp/mqtt for streaming sources.

3. Configure Filters: Filters transform and enrich log records. The kubernetes filter adds pod metadata, grep matches patterns, parser applies custom parsers, and modify adds/removes fields.

4. Set Outputs: Outputs route logs to destinations. Choose from Elasticsearch, Loki, Kafka, S3, Datadog, CloudWatch, Splunk, Prometheus, and more. Each output supports buffering, TLS, retry policies, and format options.

5. Add Parsers: Parsers define how raw log lines are structured. Built-in parsers handle JSON, regex, logfmt, combined, NGINX, Apache, Docker, and CRI formats.

Best Practices

  • Always set <code>Mem_Buf_Limit</code> on inputs to prevent out-of-memory conditions — start with 16MB and scale based on throughput.
  • Use the <code>kubernetes</code> filter with <code>Merge_Log On</code> and <code>Kube_Tag_Prefix</code> to properly enrich container logs with pod metadata.
  • Enable the HTTP server in the SERVICE section for Prometheus metrics collection and health checking.
  • Configure <code>Retry_Limit</code> on outputs to handle transient failures gracefully without losing logs.
  • Use <code>DB</code> and <code>DB.lock</code> on tail inputs to track file offsets across restarts, preventing duplicate log delivery.
  • Set <code>Refresh_Interval</code> to control how often Fluent Bit checks for new log lines — lower values reduce latency but increase CPU usage.
  • Use TLS encryption for all network-forwarding inputs and outputs in production environments.
  • Keep Fluent Bit configurations modular using <code>Include</code> directives to separate inputs, filters, and outputs into distinct files.

Common Mistakes

  • Setting <code>Mem_Buf_Limit</code> too low causes Fluent Bit to drop logs when downstream outputs are slow or unavailable.
  • Forgetting to set <code>DB</code> on tail inputs causes duplicate logs to be reprocessed after Fluent Bit restarts.
  • Not configuring <code>Retry_Limit</code> on outputs can lead to infinite retry loops that consume resources.
  • Using incorrect <code>Match</code> patterns in filters — patterns must match the tag exactly or use wildcards like <code>kube.*</code>.
  • Omitting the parsers file path in the SERVICE section when using custom parsers in INPUT sections.

Security Recommendations

  • Enable TLS for all outputs that forward logs over networks — configure <code>Tls On</code>, <code>Tls.verify On</code>, and provide CA certificates.
  • Use <code>HTTP_User</code> and <code>HTTP_Passwd</code> for basic authentication on the built-in HTTP server.
  • Restrict the HTTP server to listen on <code>127.0.0.1</code> instead of <code>0.0.0.0</code> to prevent external access to metrics.
  • Run Fluent Bit as a non-root user with minimal permissions — use <code>Set_Daemon Off</code> for debugging only.
  • Rotate log files and configure retention policies to prevent disk exhaustion attacks.

Production Tips

  • Deploy Fluent Bit as a Kubernetes DaemonSet with resource limits (CPU: 100m, Memory: 128Mi) for predictable performance.
  • Use <code>docker</code> filter with <code>Docker_Mode On</code> to automatically parse multi-line Docker logs into single records.
  • Configure <code>storage.type filesystem</code> in the SERVICE section for disk-backed buffering, enabling survival across restarts.
  • Monitor Fluent Bit metrics via the Prometheus endpoint at <code>/api/v1/metrics/prometheus</code> for throughput, errors, and buffer usage.
  • Use <code>Tag</code> patterns with wildcards (<code>kube.*</code>, <code>var.log.*</code>) to efficiently route logs through filter and output chains.
  • Set <code>storage.backlog.mem_limit</code> to control memory usage for backlog chunks when outputs are temporarily unavailable.

Frequently Asked Questions

What is Fluent Bit?
Fluent Bit is an open-source, lightweight log processor and forwarder written in C. It is part of the Fluentd ecosystem (CNCF graduated project) and is designed for high-performance log collection with minimal resource usage (~1MB memory). It supports 80+ input, filter, and output plugins.
What is the difference between Fluent Bit and Fluentd?
Fluent Bit is a lightweight log collector (~1MB memory) designed for edge collection, while Fluentd is a full-featured data collector (~150MB memory) designed for advanced routing and aggregation. Fluent Bit is ideal for DaemonSets and resource-constrained environments. Many production setups use Fluent Bit forwarding to Fluentd for processing.
What configuration format does Fluent Bit use?
Fluent Bit uses an INI-style configuration file (fluent-bit.conf) with sections: [SERVICE] for global settings, [INPUT] for data sources, [FILTER] for processing, [OUTPUT] for destinations, and [PARSER] for custom log parsing rules. It also supports YAML format.
How do I deploy Fluent Bit on Kubernetes?
Deploy Fluent Bit as a DaemonSet so it runs on every node. Mount /var/log/containers and /var/lib/docker/containers as hostPath volumes. Use the kubernetes filter to enrich logs with pod metadata. Forward output to Elasticsearch, Loki, or a Fluentd aggregator.
What are the key performance tuning parameters?
Key parameters include: Flush interval (SERVICE section), Mem_Buf_Limit (INPUT sections), storage.backlog.mem_limit, and output Buffer_Size. For high-throughput environments, increase Mem_Buf_Limit to 32-64MB, set Flush to 1-5 seconds, and configure disk-backed buffering with storage.type filesystem.
How do I troubleshoot Fluent Bit log loss?
Enable the HTTP server and check Prometheus metrics for buffer overflow and dropped records. Verify Mem_Buf_Limit is sufficient. Check output Retry_Limit and network connectivity. Enable storage.type filesystem for disk-backed buffering. Review Fluent Bit logs for errors and warnings.

Related Generators