public override async Task BootstrapElasticsearchAsync()

in src/Elastic.Ingest.Elasticsearch.CommonSchema/EcsIndexChannel.cs [65:95]


		public override async Task<bool> BootstrapElasticsearchAsync(BootstrapMethod bootstrapMethod, string? ilmPolicy = null, CancellationToken ctx = default)
		{
			if (bootstrapMethod == BootstrapMethod.None) return true;

			var name = TemplateName;
			var match = TemplateWildcard;
			if (await IndexTemplateExistsAsync(name, ctx).ConfigureAwait(false)) return false;

			foreach (var kv in IndexComponents.Components)
			{
				if (!await PutComponentTemplateAsync(bootstrapMethod, kv.Key, kv.Value, ctx).ConfigureAwait(false))
					return false;
			}
			var additionalComponents = new List<string>();
			if (!string.IsNullOrEmpty(ilmPolicy))
			{
				// create a component template that sets  index.lifecycle.name
				var (settingsName, settingsBody) = GetDefaultComponentSettings(name, ilmPolicy);
				if (!await PutComponentTemplateAsync(bootstrapMethod, settingsName, settingsBody, ctx).ConfigureAwait(false))
					return false;
				additionalComponents.Add(settingsName);
			}

			var template = IndexTemplates.GetIndexTemplateForElasticsearchComposable(match, additionalComponents.ToArray());
			//hack but this would setup the target as a datastream
			template = template.Replace("\"data_stream\": {},", "");
			if (!await PutIndexTemplateAsync(bootstrapMethod, name, template, ctx).ConfigureAwait(false))
				return false;

			return true;
		}