elastic / ecs-dotnet

https://www.elastic.co/guide/en/ecs-logging/dotnet/current/setup.html
Apache License 2.0
114 stars 58 forks source link

[Question/Feature] How to set Index Lifecycle Policy #326

Closed Baklap4 closed 1 year ago

Baklap4 commented 1 year ago

ECS integration/library project(s) (e.g. Elastic.CommonSchema.Serilog): Elastic.Serilog.Sinks -> 8.6.0 Elastic.CommonSchema.Serilog -> 8.6.0 Is your feature request related to a problem? Please describe. Currently the datastream will use the standard logs index lifecycle policy. How to configure this to another policy within our code?

Describe the solution you'd like Programaticly define the index lifecycle policy and attach them to the datastream.

Describe alternatives you've considered Changing the ilm through kibana, but this is a hassle

Mpdreamz commented 1 year ago

The bootstrap method exposes ilmPolicy as an argument

https://github.com/elastic/ecs-dotnet/blob/b8e730d9e60c52b8c413656d536b6f56d1c438c2/src/Elastic.Ingest.Elasticsearch.CommonSchema/EcsDataStreamChannel.cs#L39

But this is not wired through in any of the logging provider integrations. Will open a PR to add this!

Thanks for bringing this to my attention