Generates, validates, and optimizes Fluent Bit configurations for production use. Use when creating new Fluent Bit configs, implementing log collection pipelines (INPUT, FILTER, OUTPUT sections), configuring Kubernetes log collection with metadata enrichment, forwarding logs to destinations (Elasticsearch, Loki, S3, Kafka, CloudWatch, OpenTelemetry), building multi-line log parsing, or converting existing logging configurations to Fluent Bit.
94%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
Low
Low-risk findings worth noting
Use this skill when you need to:
fluentbit-validator.Mem_Buf_Limit so a burst cannot exhaust memory.Match * on all outputs duplicates and misroutes logs.fluent-bit.conf.fluentbit-validator before calling it done.scripts/generate_config.py and the reference configs before writing a config by hand.Identify the following before generating:
Use AskUserQuestion if key information is missing.
python3 scripts/generate_config.py --helpSupported use cases: kubernetes-elasticsearch, kubernetes-loki, kubernetes-cloudwatch, kubernetes-opentelemetry, application-multiline, syslog-forward, file-tail-s3, http-kafka, multi-destination, prometheus-metrics, lua-filtering, stream-processor, custom
python3 scripts/generate_config.py --use-case kubernetes-elasticsearch --output fluent-bit.conf
python3 scripts/generate_config.py --use-case kubernetes-opentelemetry --cluster-name my-cluster --output fluent-bit.confState explicitly why the script was not used (e.g., "Manual generation chosen because grep filter for log levels is not supported by the script").
Before writing any manual config:
assets/, production-ready reference configs are available for all 13 use cases (e.g. kubernetes-elasticsearch.conf, kubernetes-loki.conf, application-multiline.conf, multi-destination.conf, full-production.conf, and others).assets/parsers.conf, reuse existing parsers (docker, cri, json, nginx, apache, syslog-rfc3164/5424, multiline-java/python/go/ruby) before creating custom ones.Manual configuration structure: a fluent-bit.conf plus an optional parsers.conf, in the order SERVICE, INPUT, FILTER, OUTPUT. A minimal tail input looks like this; see references/manual-config-structure.md for the full skeleton.
[INPUT]
Name tail
Tag kube.*
Path /var/log/containers/*.log
Parser docker
DB /var/log/flb_kube.db
Mem_Buf_Limit 50MB
Skip_Long_Lines OnFilter example (parse JSON from the log key):
[FILTER]
Name parser
Match *
Key_Name log
Parser json
Reserve_Data OnOutput example (Elasticsearch, routed by tag, TLS verified):
[OUTPUT]
Name es
Match kube.*
Host elasticsearch.logging.svc
Port 9200
Retry_Limit 3
tls On
tls.verify OnFilters and outputs: order matters, parsers before modifiers. See references/filter-patterns.md for parser, grep, multiline, Lua and throttle filters, and references/output-patterns.md for Loki, S3, Kafka, CloudWatch, OpenTelemetry, HTTP and stdout outputs.
Plugin documentation lookup (when needed for unfamiliar plugins):
mcp__context7__resolve-library-id with "fluent-bit", then mcp__context7__get-library-docs with the plugin topic."fluent-bit" "<plugin-type>" "<plugin-name>" "configuration" site:docs.fluentbit.ioSyntax check before finalizing:
[SECTION] formatMatch tags are consistent with Tag values on inputsparsers.conf or Parsers_FileInvoke the fluentbit-validator skill on the generated config to run:
fluent-bit binary is availableFix any reported issues and re-validate until all checks pass.
python3 <validator-skill-dir>/scripts/validate_config.py --file fluent-bit.conf --check all
fluent-bit -c fluent-bit.conf --dry-runWhen delivering a configuration:
${ENV_VAR} syntax, never hardcode secretstls.verify On in production; if Off is needed add an inline comment explaining why (e.g., # Internal cluster with self-signed certs)| Concern | Recommendation |
|---|---|
| OOM prevention | Mem_Buf_Limit 50MB on every tail input |
| Crash recovery | DB /var/log/flb_kube.db on tail inputs |
| Log loops | Exclude_Path *fluent-bit*.log |
| Credentials | ${ENV_VAR} only, never hardcode |
| TLS | tls On + tls.verify On in production |
| Retries | Retry_Limit 3-5 on all outputs |
| Disk buffer | storage.total_limit_size to prevent exhaustion |
| Health checks | HTTP_Server On, probe GET :2020/api/v1/health |
| Bandwidth | Enable compression gzip on network outputs |
| Structured logs | Prefer JSON app logs; use Merge_Log On in K8s filter |
Match * on all output plugins simultaneouslyWHY: Broadcasting all logs to every output creates duplicate records in each destination, generates unexpected ingestion costs, and leaks logs intended for one system (e.g., a debug sink) into another (e.g., a billed SaaS platform).
BAD: Three separate output plugins all configured with Match *.
GOOD: Use distinct tag namespaces (kube.*, app.*, system.*) and route each namespace to its intended destination with a specific Match pattern.
Mem_Buf_Limit on INPUT pluginsWHY: Without a memory buffer limit, backpressure from a slow or unavailable output causes the input buffer to grow without bound, leading to OOM kills of the Fluent Bit process and log loss.
BAD: [INPUT] Name tail Tag app.* with no Mem_Buf_Limit setting.
GOOD: Add Mem_Buf_Limit 50MB to every tail input (adjust the value based on measured log volume).
Retry_Limit False in outputs without monitoringWHY: Infinite retries mask persistent delivery failures. Retry buffers accumulate on disk, eventually exhausting storage and causing Fluent Bit to drop new logs to protect itself.
BAD: Retry_Limit False in an output plugin with no alerting on delivery failure metrics.
GOOD: Set Retry_Limit 5 and monitor for delivery failures using Fluent Bit's built-in Prometheus metrics (/api/v1/metrics).
json or logfmt parsers applyWHY: Regexp parsers are fragile, they break when log format details change, and CPU-intensive compared to native parsers. Using them for standard formats sacrifices correctness and performance for no benefit.
BAD: Parser regex_json configured to extract fields from JSON-formatted log lines.
GOOD: Parser json, simpler, faster, and guaranteed to handle all valid JSON log output correctly.
fluent-bit.confWHY: Configuration files are routinely committed to source control, copied into container images, and displayed in support tickets. Inline credentials are then exposed to anyone who can read the file.
BAD: HTTP_Passwd secretpassword written directly in the config file.
GOOD: Reference environment variables, HTTP_Passwd ${LOKI_PASSWORD}, and inject the value at runtime via Kubernetes secrets or a secrets manager.
Exclude_Path for Fluent Bit's own logs when tailing container logsWHY: Fluent Bit reading its own container log creates a feedback loop in which each processed record produces more log lines to process.
BAD: Path /var/log/containers/*.log with no Exclude_Path.
GOOD: Exclude_Path /var/log/containers/*fluent-bit*.log alongside the tail Path.
DB position file on tail inputsWHY: Without a DB file, Fluent Bit loses its read position on restart and re-reads or skips log lines.
BAD: A tail input with no DB setting.
GOOD: DB /var/log/flb_kube.db on tail inputs for crash recovery.
WHY: tls.verify Off exposes log traffic to interception and is easily carried over from testing.
BAD: tls.verify Off on an HTTP or OpenTelemetry output sending to an external host.
GOOD: tls On and tls.verify On; if Off is genuinely needed, add an inline comment explaining why.
WHY: Generated or hand-written configs can contain tag mismatches, missing parsers or insecure settings that only a validation pass reveals.
BAD: Deliver the file straight after scripts/generate_config.py writes it.
GOOD: Run the fluentbit-validator skill on the output, fix reported issues and re-validate until all checks pass.
| Topic | Reference | When to Use |
|---|---|---|
| Full config skeleton | references/manual-config-structure.md | Writing a config by hand because the script does not cover the use case |
| FILTER patterns | references/filter-patterns.md | Adding parser, grep, multiline, Lua or throttle filters |
| OUTPUT patterns | references/output-patterns.md | Configuring Loki, S3, Kafka, CloudWatch, OpenTelemetry, HTTP or stdout outputs |
| Generation script | scripts/generate_config.py | Template-based config generation (13 use cases) |
| Example configs | assets/*.conf | Production-ready reference configurations |
| Parser library | assets/parsers.conf | Reusing existing parsers before writing custom ones |
| Official docs | docs.fluentbit.io | Plugin reference |
| context7 docs | /fluent/fluent-bit-docs | MCP-accessible documentation |
pantheon-org/tekhne
c8416e9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.