Skip to content

fix(helm): honor logstashFormat: false in the Elasticsearch ClusterOutput - #2113

Merged
joshuabaird merged 1 commit into
fluent:masterfrom
lbarrosby:fix/chart-es-logstash-format
Nov 5, 2026
Merged

joshuabaird merged 1 commit into
fluent:masterfrom
lbarrosby:fix/chart-es-logstash-format

Conversation

@lbarrosby

@lbarrosby lbarrosby commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

fluentbit.output.es.logstashFormat is documented in values.yaml as a commented example, but setting it to false has no effect. The template renders it with | default true, and Sprig's default treats false as empty, so the es ClusterOutput always gets logstashFormat: true. That makes it impossible to write to a fixed index (or a data stream) through the chart, since Fluent Bit ignores Index when Logstash_Format is on.

The template now uses dig "logstashFormat" true .Values.fluentbit.output.es, so the default of true still applies when the key is not set, and an explicit false is kept.

Checked with helm template (es output enabled):

  • key not set: logstashFormat: true (full render identical to master)
  • logstashFormat=true: true
  • logstashFormat=false: true on master, false with this change

helm lint charts/fluent-operator passes, and the rendered ClusterOutput validates with kubeconform against the chart's clusteroutputs CRD schema.

Which issue(s) this PR fixes:

None, no issue was open for this.

Does this PR introduced a user-facing change?

Helm chart: fluentbit.output.es.logstashFormat can now be set to false.

Additional documentation, usage docs, etc.:


…tput

The template piped the value through 'default true', and Sprig's default
treats false as empty, so logstashFormat always rendered true. Use dig so
the default only applies when the key is not set.

Signed-off-by: Lucas Barros <lucasbarros.kam@gmail.com>

@joshuabaird joshuabaird left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this looks good. I checked it with helm template: an unset key still renders true, and false now comes through as false.

Two small notes, neither blocking:

  • An explicit logstashFormat: null now renders an empty value. The field gets dropped and Fluent Bit falls back to its own default (off) instead of the chart's true. That's an unlikely input, so I'm fine leaving it as is.
  • The Fluentd Elasticsearch and OpenSearch templates hardcode logstashFormat: true, so Fluentd users can't turn it off either. That would be a good follow-up PR.

@joshuabaird
joshuabaird merged commit 79625bd into fluent:master Nov 5, 2026
10 checks passed
@lbarrosby

Copy link
Copy Markdown
Contributor Author

Thanks for the detailed review and the follow-up ideas, I sent them as #2114, #2115 and #2118.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants