Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

The serilog-events-template index pattern doesn't match the index name #474

Open
3 of 6 tasks
MahmoudSamir101 opened this issue Oct 8, 2022 · 0 comments
Open
3 of 6 tasks

Comments

@MahmoudSamir101
Copy link

A few questions before you begin:

Is this an issue related to the Serilog core project or one of the sinks or
community projects.
This issue list is intended for Serilog Elasticsearch Sink issues. If this issue relates to another sink or to the code project,
please log on the related repository. Please use Gitter chat and Stack Overflow for discussions and questions.

Does this issue relate to a new feature or an existing bug?

  • Bug
  • New Feature

What version of Serilog.Sinks.Elasticsearch is affected? Please list the related NuGet package.

  • Serilog.Sinks.Elasticsearch, v8.4.1

What is the target framework and operating system? See target frameworks & net standard matrix.

  • .net 6.0
  • netCore 2.0
  • netCore 1.0

Please describe the current behavior?

When the IndexFormat contains capital letters such as Test-{0:yyyy-MM-dd} , the serilog-events-template is created with index pattern Test.* and the index is created with the name test-2022-10-08,

which results in the index not being created based on the index template settings and settings such as the number of shards or replicas are ignored.

Please describe the expected behavior?
The serilog-events-template index pattern should match the index name, the index pattern can be lowercase to match the index name

If the current behavior is a bug, please provide the steps to reproduce the issue and if possible a minimal demo of the problem

builder.Host.UseSerilog((context, services, configuration)
    => configuration.WriteTo.Console()
    .WriteTo.Elasticsearch(new ElasticsearchSinkOptions()
    {
        IndexFormat = $"Test-{{0:yyyy-MM-dd}}",
        AutoRegisterTemplateVersion = AutoRegisterTemplateVersion.ESv7,
        AutoRegisterTemplate = true,
        OverwriteTemplate = true,
        NumberOfReplicas = 10,
        NumberOfShards = 10
    }));  

Kibana

Screenshot 2022-10-08 154312

Screenshot 2022-10-08 154400

Screenshot 2022-10-08 154129

Screenshot 2022-10-08 154442

Elasticsearch Logs

elk

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

No branches or pull requests

1 participant