Currently, there are two different types of Elasticsearch index templates that the tooling generates:
The first is compatible with the legacy index template API, _template. This type will appear in the output directory at generated/elasticsearch/7/template.json for the 7.x compatible version.
The second is intended for use with the v2 index template API, _index_template. The generated example in the ECS tooling also makes use of component templates (more details here). The component template will be found at generated/elasticsearch/template.json with the component templates in the generated/elasticsearch/component directory.
Which template file are you trying to use in these examples?
Based on the error message and use of data_stream: { }, it looks like you're using the _index_template API?
You're correct that the exception from _index_template API is due to the aliases, mappings, and settings configs to be nested underneath template now:
There's a known issue for the ECS tooling where custom settings for --template-settings aren't applied to the generated composable template. You may be experiencing the same problem if you're not seeing your --template-settings applied correctly. Work is in progress to fix this issue.
Eric, thanks for the response.
Yes, I am using _index_template API.
I was using generated/elasticsearch/7/template.json for the above API and ran into exception.
For now, we can manually edit either template.json files to have it work with _index_template (required by datastream).
We extend ECS schemas and named object starting with upper case, e.g., Link, Metric.Cpu.
The tool generates index template with composed_of as following:
Elasticsearch throws exception due to upper case in the component_index names.
Is there an option to have all lower case for component index names?
Is there a way to have ONLY index template and NOT component templates in ECS Tooling 1.8 (just as legacy template)?
This is a bug since a component template name must be lower case. I've created an issue to track here.
This isn't something the tooling generates today. It either the single template using the legacy template format or the current index template format using composable templates.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.