/platform-extras-skills:fluent-bit-log-forwarding-configurationfrom platform-extras-skills
Configures Fluent Bit as a lightweight log forwarder — INPUT sources (tail, systemd, Kubernetes container logs), FILTER stages (kubernetes metadata enrichment, parser, grep, modify, nest/lift), and OUTPUT routing to Loki, Elasticsearch/OpenSearch, or S3, including multiple outputs via tags/Match and backpressure/buffering settings.
Ships in platform-extras-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fluent Bit's entire job is moving log data reliably from wherever it's
produced to wherever it needs to land, through a pipeline of INPUT
(where logs come from), FILTER (enrichment/transformation/dropping),
and OUTPUT (where logs go) sections connected by tags and
Match patterns — and because it typically runs as a DaemonSet on every
node, a misconfigured pipeline doesn't just misroute logs, it can
silently drop them cluster-wide or exhaust node memory buffering
backpressure from a slow downstream. This skill covers building that
INPUT → FILTER → OUTPUT pipeline for the common Kubernetes case
(container log tailing, Kubernetes metadata enrichment, routing to
Loki/Elasticsearch/S3) and the buffering/backpressure settings that
determine what happens when an output is slow or unavailable. It assumes
the destination (Loki) is already configured to receive pushed logs —
see
loki-log-aggregation-configuration
— and does not cover writing queries against the logs once they land
(see
logql-query-authoring).
.conf
INI-style format is also still supported and shown where the
distinction matters)./var/log/containers (and /var/log/pods, /var/lib/docker/ containers depending on the container runtime's log location) and a
ServiceAccount with RBAC to read Pod/Namespace metadata for the
kubernetes filter.storage.path if using filesystem-backed buffering — required
for genuine at-least-once delivery guarantees under backpressure.Configure the INPUT to tail container logs, tagging by pod/ container path so downstream filters/outputs can route on it:
# fluent-bit.yaml (Fluent Bit 2.x YAML config)
pipeline:
inputs:
- name: tail
path: /var/log/containers/*.log
tag: kube.*
refresh_interval: 5
mem_buf_limit: 50MB
skip_long_lines: on
db: /var/log/flb_kube.db
storage.type: filesystem
db (the SQLite position database) lets Fluent Bit resume from where
it left off after a restart instead of re-reading or skipping logs;
storage.type: filesystem (see step 6) is what actually makes
buffering durable across a Fluent Bit restart, not just the db file
alone.
Enrich with Kubernetes metadata using the kubernetes filter
before any routing decision that depends on namespace/labels:
filters:
- name: kubernetes
match: kube.*
kube_url: https://kubernetes.default.svc:443
kube_tag_prefix: kube.var.log.containers.
merge_log: on
merge_log_key: log_processed
k8s-logging.parser: on
k8s-logging.exclude: on
k8s-logging.exclude: on (paired with a
fluentbit.io/exclude: "true" pod annotation) lets specific
noisy/irrelevant pods opt out of shipping entirely — cheaper than
filtering their volume downstream after ingestion.
Parse application-specific log formats with a dedicated parser
filter (or Parser set directly on the tail input for a single
known format) rather than shipping unstructured lines and hoping the
backend parses them:
parsers:
- name: app_json
format: json
time_key: timestamp
time_format: "%Y-%m-%dT%H:%M:%S.%L%z"
- name: multiline_stacktrace
format: regex
regex: '^(?<time>\d{4}-\d{2}-\d{2}[^ ]* )(?<level>\w+) (?<message>.*)'
filters:
- name: parser
match: kube.payments-api.*
key_name: log
parser: app_json
reserve_data: on
For multi-line stack traces specifically, use the multiline filter
(or multiline.parser on the tail input in newer versions) rather
than a regex parser alone — a plain parser processes line-by-line and
cannot join a Java/Python stack trace's continuation lines back into
one log entry on its own.
Drop or redact fields that shouldn't be shipped downstream — secrets accidentally logged, overly verbose fields, or fields that would become unbounded labels at the Loki destination:
filters:
- name: modify
match: kube.*
remove: authorization
remove: password
- name: grep
match: kube.*
exclude: log healthcheck
Warning: never rely on a downstream system (Loki, Elasticsearch) to redact secrets that were accidentally logged — filter them out at the forwarder, as close to the source as practical, since anything that reaches the destination is retained per its retention policy and may be readable by anyone with query access.
Route to multiple outputs by tag/Match, sending different log
classes to the destination appropriate for each — this is the core of
"different logs, different backends":
outputs:
- name: loki
match: kube.payments.*
host: loki-gateway.monitoring.svc
port: 3100
labels: job=fluentbit, namespace=$kubernetes['namespace_name'], app=$kubernetes['labels']['app']
line_format: json
- name: es
match: kube.security-audit.*
host: opensearch.security.svc
port: 9200
index: security-audit
suppress_type_name: on
- name: s3
match: kube.compliance-audit.*
bucket: <S3_BUCKET_NAME>
region: <AWS_REGION>
total_file_size: 50M
upload_timeout: 10m
use_put_object: on
Warning — Loki label cardinality: the
labelsfield on thelokioutput plugin becomes indexed Loki stream labels exactly like any other Loki label — never map an unbounded Kubernetes field (pod name, pod IP, a per-request annotation) into it. Stick tonamespace_name,app/container_name, and similarly bounded values, per loki-log-aggregation-configuration.
Enable filesystem-backed buffering for genuine delivery
guarantees under backpressure — the default in-memory-only buffering
drops logs once mem_buf_limit is hit if the output is slow/down:
service:
flush: 5
storage.path: /var/log/flb-storage
storage.sync: normal
storage.checksum: off
storage.max_chunks_up: 128
storage.backlog.mem_limit: 64MB
Filesystem buffering (storage.type: filesystem on the relevant
inputs, plus service.storage.path set) persists chunks to local
disk when memory limits are reached, trading some latency/disk usage
for not silently dropping logs during a downstream outage — worth it
for anything where log loss during an incident is unacceptable
(audit/compliance streams especially).
Set retry and backoff behavior on outputs so a transient destination outage doesn't either drop data immediately or retry so aggressively it worsens an already-struggling downstream:
outputs:
- name: loki
match: kube.payments.*
host: loki-gateway.monitoring.svc
port: 3100
retry_limit: 5
net.connect_timeout: 10
Validate and dry-run the pipeline before rolling out broadly —
see
fluent-bit-configuration-validation
for the full pre-deploy validation workflow (fluent-bit --dry-run,
testing parsers against sample lines); at minimum, confirm the
pipeline is emitting before a cluster-wide rollout:
fluent-bit -c fluent-bit.yaml -o stdout -m '*'
k8s-logging.exclude/a pod annotation to opt noisy, low-value pods
out of shipping entirely rather than filtering their volume downstream
after it's already been ingested (and, for Loki, already counted
against ingestion limits).authorization, password, API keys
accidentally logged) at the Fluent Bit filter stage, as close to the
source as practical — never depend on the destination to scrub them
after the fact.labels — namespace and app/service name, not pod name, pod
IP, or any per-request value.storage.type: filesystem buffering for any log stream where
loss during a downstream outage is unacceptable (audit/compliance
logs, anything feeding a security pipeline) — accept the in-memory-only
default only for genuinely disposable/best-effort telemetry.retry_limit/timeouts on every output — an output with
unlimited retries against a persistently failing destination can pile
up buffered chunks and pressure the node, while an output with none
drops data on the first transient blip.Symptom: Logs stop appearing at the destination during a
downstream outage (Loki/Elasticsearch restart, network blip), and some
log lines from that window never show up even after the destination
recovers.
Fix: Buffering was in-memory only (storage.type not set to
filesystem), so once mem_buf_limit was hit during the outage,
Fluent Bit dropped further input rather than queuing it to disk. Enable
filesystem-backed buffering (step 6) for any stream where this loss is
unacceptable.
Symptom: A node running the Fluent Bit DaemonSet runs low on disk
space or memory, and it's traced back to log forwarding.
Fix: Filesystem buffering was enabled without a bounded
storage.backlog.mem_limit/storage.max_chunks_up, or mem_buf_limit
on the tail input was left too high relative to node capacity, so
buffered chunks accumulated unbounded during a prolonged downstream
outage instead of being capped. Set explicit limits sized to the
node's actual available resources, and pair with alerting on Fluent
Bit's own buffer/retry metrics so this is caught before it becomes a
node-level incident.
Symptom: Multi-line Java/Python stack traces show up in the
destination as dozens of separate single-line log entries instead of
one coherent trace.
Fix: A regex/json parser was applied line-by-line without a
multiline filter (or multiline.parser on the input) to join
continuation lines. Add multiline handling explicitly for any log
format that spans multiple physical lines per logical entry.
Symptom: A Loki output starts getting 429/rejected ingestion
shortly after a new field was added to the labels mapping on the
loki output plugin.
Fix: The new label maps an unbounded Kubernetes field (pod name,
pod IP) into Loki's indexed labels, exploding stream count on the Loki
side. Remove it from the output's labels mapping and, if the field
is genuinely useful for querying, ship it as part of the log line
content instead (parsed at query time via LogQL, per
logql-query-authoring).
Symptom: After adding a new grep/modify filter meant to
redact a sensitive field, the field still shows up at the destination.
Fix: The filter's Match pattern doesn't actually match the tag
of the logs carrying that field (commonly a tag-prefix mismatch after
the kubernetes filter's kube_tag_prefix rewrites tags), so the
filter is silently never applied to the intended stream. Confirm with
fluent-bit -c fluent-bit.yaml -o stdout -m '*' that the filter's
match pattern actually catches the target tag before assuming the
filter itself is broken.
Symptom: Two teams' logs, meant to go to two different outputs
(e.g. payments to Loki, security-audit to Elasticsearch), both end
up in both destinations.
Fix: Both outputs' match patterns are broader than intended
(e.g. both using kube.* instead of a properly scoped tag), so every
output matches every input. Scope match patterns as narrowly as the
actual tag structure allows (kube.payments.* vs.
kube.security-audit.*), and verify with the stdout dry-run before
rolling out to production destinations.
Scenario: A Kubernetes cluster needs Fluent Bit configured to: ship
payments namespace application logs to Loki with Kubernetes metadata,
ship security-audit namespace logs to OpenSearch, and archive
compliance-audit namespace logs to S3 for 7-year retention — with
filesystem buffering so a Loki maintenance window doesn't lose payments
logs.
service:
flush: 5
storage.path: /var/log/flb-storage
storage.sync: normal
storage.backlog.mem_limit: 64MB
pipeline:
inputs:
- name: tail
path: /var/log/containers/*.log
tag: kube.*
db: /var/log/flb_kube.db
storage.type: filesystem
mem_buf_limit: 50MB
filters:
- name: kubernetes
match: kube.*
kube_tag_prefix: kube.var.log.containers.
merge_log: on
k8s-logging.exclude: on
- name: modify
match: kube.*
remove: authorization
remove: password
outputs:
- name: loki
match: kube.var.log.containers.*payments*
host: loki-gateway.monitoring.svc
port: 3100
labels: job=fluentbit, namespace=$kubernetes['namespace_name'], app=$kubernetes['labels']['app']
retry_limit: 5
- name: es
match: kube.var.log.containers.*security-audit*
host: opensearch.security.svc
port: 9200
index: security-audit
retry_limit: 3
- name: s3
match: kube.var.log.containers.*compliance-audit*
bucket: <S3_BUCKET_NAME>
region: <AWS_REGION>
total_file_size: 100M
upload_timeout: 10m
storage.type: filesystem on the shared tail input means that when
Loki goes into a planned maintenance window, payments logs buffer to
local disk (bounded by storage.backlog.mem_limit) instead of being
dropped, and drain automatically once Loki is reachable again — verified
before rollout with the stdout dry-run and the checks in
fluent-bit-configuration-validation.
loki output must respect.labels mapping here.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub selvarajmurugesan90/ops-engineering-skills --plugin platform-extras-skills16 skills in this plugin
/backstage-developer-portalGuides building an internal developer portal with Backstage — authoring catalog-info.yaml to register services in the software catalog, setting up TechDocs for docs-as-code, writing Software Templates to scaffold new services, and understanding the plugin architecture. Use when a user asks to "register a service in Backstage", "write a catalog- info.yaml", "set up TechDocs", "create a Backstage software template for scaffolding new repos", "add a Backstage plugin", or "build an internal developer portal."
/distributed-tracing-with-tempo-and-jaegerGuides configuring Grafana Tempo or Jaeger as the distributed tracing backend — trace storage backend selection and retention, sampling strategy at the backend/collector level (head-based vs. tail-based), and trace-to-metrics/trace-to-logs correlation so a trace ID can pivot directly into a log line or a metrics exemplar. Use when the user asks to "set up Tempo," "configure Jaeger storage," "set trace retention," "configure trace-to-logs correlation in Grafana," "design a sampling strategy for traces," or "query traces with TraceQL." This is the tracing *backend/storage* layer — instrumenting applications and configuring the OpenTelemetry Collector that feeds this backend is covered separately in opentelemetry-instrumentation-and-collector-configuration.
/fluent-bit-configuration-validationValidates Fluent Bit pipeline configuration syntax and tests the INPUT/FILTER/OUTPUT pipeline against sample log lines before a production rollout — dry-run checks, parser testing, and route/Match verification. Use when a user asks to "validate this Fluent Bit config before deploying," "test my Fluent Bit parser against sample logs," "will this Fluent Bit change break log routing," "check this Fluent Bit config in CI," or reports logs silently missing/misrouted after a Fluent Bit config change.
/incident-investigation-using-metrics-logs-tracesGuides correlating Prometheus metrics, log queries, and distributed traces together during a live incident investigation — using each signal's strengths to narrow from "something is wrong" to a specific root cause faster than any single signal alone. Use when a user asks to "investigate this incident using our metrics and logs," "find the root cause across dashboards, logs, and traces," "correlate this latency spike with logs and a trace," "pivot from an alert to the actual failing request," or is actively triaging a live production issue and needs a systematic cross-signal approach rather than guessing which dashboard to check next.
/karpenter-cluster-autoscalingGuides configuring Karpenter for Kubernetes node autoscaling — NodePool and EC2NodeClass (or equivalent) provisioning, consolidation and bin-packing behavior, Spot/On-Demand mixing, and how Karpenter compares to and can replace the Kubernetes Cluster Autoscaler. Use when a user asks to "set up Karpenter", "write a NodePool spec", "reduce node cost via consolidation/bin-packing", "mix Spot and On-Demand nodes", "choose between Karpenter and Cluster Autoscaler", or "debug why pods are stuck Pending / a node won't scale down."
/kubecost-cost-visibilityGuides deploying Kubecost inside Kubernetes clusters to allocate cloud spend down to namespace, workload, and label, build showback/chargeback reports for platform stakeholders, and feed cost signals into cluster autoscaling and rightsizing decisions. Use when a user asks to "show cost per namespace/team/label in Kubernetes", "set up Kubecost", "build a Kubernetes showback or chargeback report", "find which workload is driving the cloud bill", "size resource requests based on cost", or "connect Kubernetes cost data to autoscaler decisions."
Other plugins' skills for the same job