Skip to content

[exporter/opensearchexporter] add logstashFormat config to opensearch #40500

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sw90lee
Copy link

@sw90lee sw90lee commented Jun 5, 2025

Description

OpenSearch currently lacks date suffixing for index names. To maintain consistency with the Elasticsearch Exporter, I implemented a similar configuration mechanism for OpenSearch and documented its usage in the README.md.

Link to tracking issue

#34746
#38595

Testing

Documentation

  • logstash_format (optional): Logstash format compatibility. Logs, metrics and traces can be written into an index in Logstash format.
    • enabled(default=false): Enable/disable Logstash format compatibility. When logstash_format::enabled is true, the index name is composed using the above dynamic routing rules as prefix and the date as suffix,
      e.g: If the computed index name is logs-generic-default, the resulting index will be logs-generic-default-YYYY.MM.DD.
      The last string appended belongs to the date when the data is being generated.
    • prefix_separator(default=-): Set a separator between logstash_prefix and date.
    • date_format(default=%Y.%m.%d): Time format (based on strftime) to generate the second part of the Index name.

@sw90lee sw90lee requested a review from a team as a code owner June 5, 2025 07:39
@sw90lee sw90lee requested a review from fatsheep9146 June 5, 2025 07:39
@ps48
Copy link

ps48 commented Jun 6, 2025

Thanks for the PR @sw90lee. I didn't see this PR and have something similar raised for Dynamic index support in OS exporter: #40530. Do you mind taking a look at it, we can coordinate how to move ahead here. Thanks again!

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

Successfully merging this pull request may close these issues.

3 participants