File tree Expand file tree Collapse file tree 3 files changed +16
-2
lines changed
Elastic.Extensions.Logging Expand file tree Collapse file tree 3 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ private IBufferedChannel<LogEvent> CreatIngestChannel(ElasticsearchLoggerOptions
185185 } ;
186186 SetupChannelOptions ( _channelConfigurations , indexChannelOptions ) ;
187187 var channel = new EcsDataStreamChannel < LogEvent > ( indexChannelOptions ) ;
188- channel . BootstrapElasticsearch ( loggerOptions . BootstrapMethod ) ;
188+ channel . BootstrapElasticsearch ( loggerOptions . BootstrapMethod , loggerOptions . IlmPolicy ) ;
189189 return channel ;
190190 }
191191 }
Original file line number Diff line number Diff line change @@ -40,6 +40,13 @@ public class ElasticsearchLoggerOptions : IEcsDocumentCreationOptions
4040 /// </summary>
4141 public BootstrapMethod BootstrapMethod { get ; set ; } = BootstrapMethod . None ;
4242
43+ /// <summary>
44+ /// The ILM Policy to apply, see the following for more details:
45+ /// <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html</para>
46+ /// Defaults to `logs` which is shipped by default with Elasticsearch
47+ /// </summary>
48+ public string ? IlmPolicy { get ; set ; }
49+
4350 /// <summary>
4451 /// The index to log into, if this is not set the logger integration will assume it will write into datastreams <see cref="DataStream"/>.
4552 /// <para>
Original file line number Diff line number Diff line change @@ -60,6 +60,13 @@ public ElasticsearchSinkOptions() : this(new DefaultHttpTransport(TransportHelpe
6060 /// <inheritdoc cref="BootstrapMethod"/>
6161 public BootstrapMethod BootstrapMethod { get ; set ; }
6262
63+ /// <summary>
64+ /// The ILM Policy to apply, see the following for more details:
65+ /// <para>https://www.elastic.co/guide/en/elasticsearch/reference/current/index-lifecycle-management.html</para>
66+ /// Defaults to `logs` which is shipped by default with Elasticsearch
67+ /// </summary>
68+ public string ? IlmPolicy { get ; set ; }
69+
6370 }
6471
6572 /// <summary>
@@ -90,7 +97,7 @@ public ElasticsearchSink(ElasticsearchSinkOptions<TEcsDocument> options)
9097 _channel = new EcsDataStreamChannel < TEcsDocument > ( channelOptions , new [ ] { new SelfLogCallbackListener < TEcsDocument > ( options ) } ) ;
9198 if ( _channel . DiagnosticsListener != null )
9299 options . ChannelDiagnosticsCallback ? . Invoke ( _channel . DiagnosticsListener ) ;
93- _channel . BootstrapElasticsearch ( options . BootstrapMethod ) ;
100+ _channel . BootstrapElasticsearch ( options . BootstrapMethod , options . IlmPolicy ) ;
94101 }
95102
96103 /// <inheritdoc cref="ILogEventSink.Emit"/>
You can’t perform that action at this time.
0 commit comments