Skip to content

feat(elasticsearch-logger): support dynamic index with time and variable resolution#13334

Merged
nic-6443 merged 3 commits into
apache:masterfrom
nic-6443:feat/elasticsearch-logger-dynamic-index
May 7, 2026
Merged

feat(elasticsearch-logger): support dynamic index with time and variable resolution#13334
nic-6443 merged 3 commits into
apache:masterfrom
nic-6443:feat/elasticsearch-logger-dynamic-index

Conversation

@nic-6443
Copy link
Copy Markdown
Member

@nic-6443 nic-6443 commented May 6, 2026

The field.index configuration now supports dynamic patterns:

  • Date/time patterns in curly brackets, e.g. services-{%Y.%m.%d}
  • APISIX variables prefixed with $, e.g. services-$host
  • Both combined, e.g. services-$host-{%Y.%m.%d}

The index is resolved per-request without mutating the plugin configuration object, so it stays dynamic across requests (e.g. rotates correctly when the date changes).

This was previously documented in the attribute table but not actually implemented in the open-source codebase.

Copilot AI review requested due to automatic review settings May 6, 2026 13:41
@dosubot dosubot Bot added size:L This PR changes 100-499 lines, ignoring generated files. enhancement New feature or request labels May 6, 2026
@nic-6443 nic-6443 force-pushed the feat/elasticsearch-logger-dynamic-index branch 2 times, most recently from cb79976 to ef11ec3 Compare May 6, 2026 14:00
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

…ble resolution

The field.index now supports date patterns in curly brackets (e.g.,
`services-{%Y.%m.%d}`) and APISIX variables prefixed with $ (e.g.,
`services-$host-{%Y.%m.%d}`). The index is resolved per-request
without mutating the plugin configuration object.
@nic-6443 nic-6443 force-pushed the feat/elasticsearch-logger-dynamic-index branch from ef11ec3 to bf40a86 Compare May 6, 2026 17:04
membphis
membphis previously approved these changes May 7, 2026
Comment thread apisix/plugins/elasticsearch-logger.lua Outdated
AlinsRan
AlinsRan previously approved these changes May 7, 2026
@nic-6443 nic-6443 dismissed stale reviews from AlinsRan, shreemaan-abhishek, and membphis via a8d2062 May 7, 2026 04:50
@nic-6443 nic-6443 merged commit 888ed6e into apache:master May 7, 2026
25 checks passed
@nic-6443 nic-6443 deleted the feat/elasticsearch-logger-dynamic-index branch May 7, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants