Skip to main content
skill CX Codex

fluentbit-generator — Claude Code skill for Fluent Bit configs

Writes Fluent Bit configs: INPUT, FILTER, OUTPUT, parsers and the whole log pipeline. Useful when you need log shipping set up without hand-picking plugin options.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add akin-ozer/cc-devops-skills --skill fluentbit-generator -a claude-code
Open on GitHub

What fluentbit-generator does

The skill walks the agent through seven stages. First it checks that python3 is present and the script loads, then asks about log sources, destinations, TLS and buffering. From there it picks between script generation and a manual build from the examples/ templates.

scripts/generate_config.py covers the common cases: Kubernetes to Elasticsearch, Loki, CloudWatch or OpenTelemetry, application multiline logs, syslog, file tail to S3, HTTP to Kafka, Prometheus metrics, Lua filtering. When a request needs plugin options the script does not expose, the skill switches to manual assembly, starts from the closest template and keeps section order fixed: [SERVICE], [INPUT], [FILTER], [OUTPUT], then parsers.

Make sure python3 is available before you start, because without it only the manual path is left. Generated files go to fluentbit-validator for checking; if that skill is missing, the fallback is fluent-bit -c <generated-config> --dry-run. Validation-only requests belong to the other skill.

What it helps with

  • build a Fluent Bit config for Kubernetes with metadata enrichment
  • ship logs to Loki, Elasticsearch or CloudWatch
  • parse multiline stack traces from an application
  • define parsers in parsers.conf and wire them into filters
  • fan out one log stream to several destinations

Example prompts for the agent

  • generate a Fluent Bit config for Kubernetes with Elasticsearch output
  • I need a log pipeline from files to S3 in us-east-1
  • add a Lua filter to my current Fluent Bit config

How to install fluentbit-generator

1Skills CLI (Vercel)

npx skills add akin-ozer/cc-devops-skills --skill fluentbit-generator -a claude-code

2Manually: put the files in place

~/.claude/skills/fluentbit-generator/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/fluentbit-generator/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about fluentbit-generator

How do I install fluentbit-generator in Claude?

Run npx skills add akin-ozer/cc-devops-skills --skill fluentbit-generator -a claude-code. The skill file then sits at ~/.claude/skills/fluentbit-generator/SKILL.md.

What does fluentbit-generator do?

It generates Fluent Bit configs: INPUT, FILTER and OUTPUT sections, parser definitions and the log pipeline. Either through the script or manually from the examples/ templates.

How is it different from fluentbit-validator?

This skill produces the config; fluentbit-validator checks it. Requests that only need validation go to the validator.

Source text

SKILL.md · Apache-2.0
---
name: fluentbit-generator
description: Generate/create Fluent Bit configs — INPUT, FILTER, OUTPUT, parsers, log pipeline.
---

# Fluent Bit Config Generator

## Trigger Guidance

Use this skill when the user asks for any of the following:
- Create or update a Fluent Bit config (`fluent-bit.conf`, `parsers.conf`)
- Build a log pipeline (INPUT -> FILTER -> OUTPUT)
- Configure Kubernetes logging with metadata enrichment
- Send logs/metrics to Elasticsearch, Loki, CloudWatch, S3, Kafka, OTLP, or Prometheus remote write
- Implement parser, multiline, lua, or stream processing behavior

Do not use this skill for pure validation-only requests; use `fluentbit-validator` in that case.

## Execution Flow

Follow this sequence exactly. Do not skip stages.

### Stage 1: Set Working Context and Preflight

Use one of these deterministic command patterns.

```bash
# Option A (recommended): run from this skill directory
cd /Users/akinozer/GolandProjects/cc-devops-skills/devops-skills-plugin/skills/fluentbit-generator
python3 scripts/generate_config.py --help
```

```bash
# Option B: run from any cwd with absolute paths
python3 /Users/akinozer/GolandProjects/cc-devops-skills/devops-skills-plugin/skills/fluentbit-generator/scripts/generate_config.py --help
```

Preflight checks:
- Confirm `python3` is available.
- Confirm script help loads without errors.
- If using relative output paths, run from the intended target cwd.

Fallback:
- If `python3` or script execution is unavailable, switch to manual generation flow (Stage 4) using `examples/` templates.

### Stage 2: Clarification Questionnaire (Explicit Template)

Collect these fields before generation.

Required questions:
1. Primary use case: `kubernetes`, `application logs`, `syslog`, `http ingest`, `metrics`, or `custom`?
2. Inputs: which sources and paths/ports (for example `tail /var/log/containers/*.log`)?
3. Outputs: destination plugin(s) and endpoint(s) (host, port, uri/topic/index/bucket)?
4. Reliability/security requirements: TLS on/off, retry expectations, buffering limits?
5. Environment context: cluster name, environment name, cloud region (if applicable)?

Optional but important:
1. Expected log format: json, regex, cri, docker, multiline stack traces?
2. Throughput profile: low/medium/high and acceptable latency?
3. Constraints: offline environment, missing binaries, read-only filesystem?

If any required answer is missing, ask focused follow-up questions before generating.

### Stage 3: Decide Script vs Manual Generation

Use this decision table.

| Condition | Path |
| --- | --- |
| Request matches a built-in use case and only needs supported flags | Script path (Stage 5) |
| Request needs uncommon plugin options not represented by script flags | Manual path (Stage 4) |
| Complex multi-filter chain, custom parser/lua logic, or specialized plugin tuning | Manual path (Stage 4) |
| Script cannot run in environment (missing Python/permissions) | Manual path (Stage 4) |
| User explicitly requests hand-crafted config | Manual path (Stage 4) |

Supported script 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`

Always state the decision explicitly, including why the other path was not used.

### Stage 4: Manual Generation (When Script Is Not the Best Fit)

1. Read the closest template in `examples/` first.
2. Read `examples/parsers.conf` before defining new parsers.
3. Assemble config in this order:
- `[SERVICE]`
- `[INPUT]`
- `[FILTER]`
- `[OUTPUT]`
- parser definitions (if needed)
4. Reuse known-good sections from examples and only customize required parameters.
5. Keep tags and parser references consistent across sections.

Required local template selection:
- Kubernetes + Elasticsearch: `examples/kubernetes-elasticsearch.conf`
- Kubernetes + Loki: `examples/kubernetes-loki.conf`
- Kubernetes + CloudWatch: `examples/cloudwatch.conf`
- Kubernetes + OpenTelemetry: `examples/kubernetes-opentelemetry.conf`
- App multiline: `examples/application-multiline.conf`
- Syslog forward: `examples/syslog-forward.conf`
- File to S3: `examples/file-tail-s3.conf`
- HTTP to Kafka: `examples/http-input-kafka.conf`
- Multi destination: `examples/multi-destination.conf`
- Metrics: `examples/prometheus-metrics.conf`
- Lua filtering: `examples/lua-filtering.conf`
- Stream processor: `examples/stream-processor.conf`
- Parsers: `examples/parsers.conf`

Fallback:
- If no matching example exists, start from `scripts/generate_config.py --use-case custom` output shape and extend manually.

### Stage 5: Script Generation Commands (Deterministic Examples)

Run from skill directory unless output path is absolute.

```bash
cd /Users/akinozer/GolandProjects/cc-devops-skills/devops-skills-plugin/skills/fluentbit-generator

# Kubernetes -> Elasticsearch
python3 scripts/generate_config.py \
  --use-case kubernetes-elasticsearch \
  --cluster-name prod-cluster \
  --environment production \
  --es-host elasticsearch.logging.svc \
  --es-port 9200 \
  --output output/fluent-bit.conf

# Kubernetes -> OpenTelemetry
python3 scripts/generate_config.py \
  --use-case kubernetes-opentelemetry \
  --cluster-name prod-cluster \
  --environment production \
  --otlp-endpoint otel-collector.observability.svc:4318 \
  --output output/fluent-bit-otlp.conf

# File tail -> S3
python3 scripts/generate_config.py \
  --use-case file-tail-s3 \
  --log-path /var/log/app/*.log \
  --s3-bucket my-logs-bucket \
  --s3-region us-east-1 \
  --output output/fluent-bit-s3.conf
```

Fallback:
- If a required option is unsupported by the script, document that gap and switch to Stage 4.

### Stage 6: Plugin Documentation Lookup Fallback Chain

Use this strict order when plugin behavior or parameters are uncertain.

1. Context7 (first choice)
- Resolve library id for Fluent Bit docs.
- Query plugin-specific configuration details.

2. Official Fluent Bit docs (second choice)
- Use `https://docs.fluentbit.io/manual` and plugin-specific pages.
- Prefer official plugin reference sections over blogs.

3. Web search (last choice)
- Use only when Context7 and official docs are unavailable/incomplete.
- Prioritize sources that quote or link official docs.

When to stop escalating:
- Stop as soon as required parameters and one validated example are found.
- If all sources are unavailable, proceed with local `examples/` and clearly mark assumptions.

### Stage 7: Validation and Fallback Behavior

Primary validation path:
- Invoke `fluentbit-validator` after generation.

If validator is unavailable, run local fallback checks:
```bash
# Syntax/format smoke check when fluent-bit is installed
fluent-bit -c <generated-config> --dry-run

# Optional execution test
fluent-bit -c <generated-config>
```

If `fluent-bit` binary is missing:
- Perform static checks manually:
  - section headers are valid (`[SERVICE]`, `[INPUT]`, `[FILTER]`, `[OUTPUT]`)
  - required plugin keys exist
  - tag/match patterns align
  - parser names/files referenced correctly
  - no hardcoded credentials
- Report that runtime validation was skipped and why.

### Stage 8: Response Contract

Always return:
1. Generation path used (`script` or `manual`) and reason.
2. Produced file(s) and key plugin choices.
3. Validation results (or explicit skip reason with fallback checks performed).
4. Assumptions, open risks, and what to customize next.

## Done Criteria

This skill execution is complete only when all are true:
- Trigger fit was explicitly confirmed.
- Clarification questionnaire captured required fields or documented assumptions.
- Script-vs-manual decision was explicit and justified.
- Plugin lookup used deterministic chain: Context7 -> official docs -> web (as needed).
- Commands were provided with cwd-safe examples.
- Fallback behavior was applied for any missing tools/docs/network constraints.
- Validation was executed (or skipped with explicit reason and fallback static checks).
- Final response included generated artifacts, validation outcome, and next customization points.

## Local Resources

- Script: `scripts/generate_config.py`
- Templates: `examples/*.conf`
- Parsers baseline: `examples/parsers.conf`
- Sample output directory: `output/`

Use these resources first before introducing new structure.

© akin-ozer · Apache-2.0 · akin-ozer/cc-devops-skills

Similar skills

All skills for DevOps and infrastructure →

From the same set29

helm-generator Scaffolds a Helm chart, its helpers and resource templates from your description. Handy when you need a chart with Deployment, Service and Ingress without writing boilerplate. CX Codex +1 633installs makefile-validator Runs Makefiles and .mk files through a syntax check, mbake linting and a set of security checks, then reports findings with an exit code. CX Codex +1 625installs makefile-generator This skill scaffolds Makefiles with .PHONY targets, standard GNU goals and validation through makefile-validator. Useful when a project needs a real build file. CX Codex +1 620installs promql-generator A skill that walks the agent through planning and produces PromQL queries, alerting rules and recording rules for Prometheus. CX Codex +1 615installs promql-validator Validates PromQL syntax, catches anti-patterns like rate() on gauges, and refines Prometheus queries via an interactive dialogue. CX Codex +1 604installs logql-generator Builds production-ready LogQL queries, metric aggregations, and Grafana Loki alert rules through a guided workflow. Useful for debugging logs and setting up dashboards. CX Codex +1 597installs fluentbit-validator Validates and lints classic-mode Fluent Bit configs before deployment. It catches issues in INPUT, FILTER, and OUTPUT sections and verifies tag routing. CX Codex +1 595installs loki-config-generator Generates production Grafana Loki server configs and Helm values for S3, GCS, Azure, or filesystem storage. Helps deploy logging clusters without hand-tuning schemas and limits. CX Codex +1 580installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor