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

Add autogenerated template IndexAliases configuration properties #522

Open
2 of 3 tasks
kazha opened this issue Mar 30, 2023 · 2 comments
Open
2 of 3 tasks

Add autogenerated template IndexAliases configuration properties #522

kazha opened this issue Mar 30, 2023 · 2 comments

Comments

@kazha
Copy link

kazha commented Mar 30, 2023

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 9.0.0

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

  • .net 6

Please describe the current behavior?
Current configuration for AutoRegisterTemplate in ElasticsearchTemplateProvider allows adding only list of alias names.
And there is no way to set properties for autogenerated template aliases.
As properties are set to an empty object

ElasticsearchTemplateProvider.cs

            //If index alias or aliases are specified
            if (options.IndexAliases?.Length > 0)
                foreach (var alias in options.IndexAliases)
                {
                    //Added blank object for alias to make look like this in JSON:
                    //"alias_1" : {}
                    aliases.Add(alias, new object());
                }

Please describe the expected behavior?
Change IndexAliases configuration so the properties like "is_write_index" can be set. Elastic aliases

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

@mivano
Copy link
Contributor

mivano commented Apr 5, 2023

I m open for PRs, although this looks like it can be a breaking change. Not a big issue as long as we bump the version and have a changelog. Would you mind working this out?

@kazha
Copy link
Author

kazha commented Apr 12, 2023

I ended up using low level client to achieve this. In a foreseeable future I won't be able to implement this myself, if at some point I'll have a free time I'll pick it up if no one else does.

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

2 participants