Skip to content

feat(fluentd): add elasticsearchDynamic output - #2129

Open
cvas22 wants to merge 1 commit into
fluent:masterfrom
cvas22:feat/1400-fluentd-es-dynamic
Open

cvas22 wants to merge 1 commit into
fluent:masterfrom
cvas22:feat/1400-fluentd-es-dynamic

Conversation

@cvas22

@cvas22 cvas22 commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

There was no way to use fluentd's elasticsearch_dynamic output from the CRDs, so if you wanted the index or logstash prefix to follow the namespace you had to fall back to a custom plugin. This adds an elasticsearchDynamic output to Output and ClusterOutput. It takes the same fields as elasticsearch and renders @type elasticsearch_dynamic, so placeholders like ${record['kubernetes']['namespace_name']} get passed straight through.

spec:
  outputs:
  - elasticsearchDynamic:
      host: elasticsearch.logging.svc
      port: 9200
      logstashFormat: true
      logstashPrefix: logs-${record['kubernetes']['namespace_name']}

Which issue(s) this PR fixes:

Fixes #1400

Does this PR introduced a user-facing change?

Fluentd Output and ClusterOutput have a new elasticsearchDynamic output that renders the elasticsearch_dynamic plugin.

Additional documentation, usage docs, etc.:

Updated docs/plugins/fluentd/output/types.md.

Notes

I reused the Elasticsearch type instead of adding a new one since the plugin is a subclass of out_elasticsearch and accepts the same params. The plugin's already in the fluentd image through fluent-plugin-elasticsearch. Upstream says it's kept for backward compat, but it's still the simplest way to route per namespace without a record_modifier step.

Adds an elasticsearchDynamic output that renders @type elasticsearch_dynamic.
It reuses the elasticsearch parameters, so host, index and logstash values can
use placeholders like ${tag_parts[1]} or ${record['key']}.

Signed-off-by: Srinivas Chippagiri <cvas22@gmail.com>
@cvas22
cvas22 force-pushed the feat/1400-fluentd-es-dynamic branch from 8f4d85f to 3127c4c Compare November 12, 2026 16:58
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.

Is the @type elasticsearch_dynamic supported by fluent-operator ?

1 participant