diff --git a/manage-data/data-store/templates/config-ignoremissingcomponenttemplates.md b/manage-data/data-store/templates/config-ignoremissingcomponenttemplates.md deleted file mode 100644 index 907b52e0bc..0000000000 --- a/manage-data/data-store/templates/config-ignoremissingcomponenttemplates.md +++ /dev/null @@ -1,18 +0,0 @@ ---- -mapped_urls: - - https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore_missing_component_templates.html - - https://www.elastic.co/guide/en/elasticsearch/reference/current/_usage_example.html ---- - -# Config ignore_missing_component_templates - -% What needs to be done: Refine - -% GitHub issue: docs-projects#372 - -% Scope notes: Combine with "Usage example" subpage. - -% Use migrated content from existing pages that map to this page: - -% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md -% - [ ] ./raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md \ No newline at end of file diff --git a/manage-data/data-store/templates/ignore-missing-component-templates.md b/manage-data/data-store/templates/ignore-missing-component-templates.md new file mode 100644 index 0000000000..7570bb0281 --- /dev/null +++ b/manage-data/data-store/templates/ignore-missing-component-templates.md @@ -0,0 +1,99 @@ +--- +mapped_urls: + - https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore_missing_component_templates.html + - https://www.elastic.co/guide/en/elasticsearch/reference/current/_usage_example.html +--- + +# Ignore missing component templates + +% What needs to be done: Refine + +% GitHub issue: docs-projects#372 + +% Scope notes: Combine with "Usage example" subpage. + +% Use migrated content from existing pages that map to this page: + +% - [x] ./raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md +% - [x] ./raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md + +When an index template references a component template that might not exist, the `ignore_missing_component_templates` configuration option can be used. With this option, every time a data stream is created based on the index template, the existence of the component template will be checked. If it exists, it will used to form the index’s composite settings. If it is missing, it will be ignored. + +The following example demonstrates how this configuration option works. + +## Example: Use the `ignore_missing_component_templates` option + +In this example, an index template and one component template are created. The index template references two component templates, but only one exists. + +Suppose the `logs-foo_component1` component template is created *before* the index template: + +```console +PUT _component_template/logs-foo_component1 +{ + "template": { + "mappings": { + "properties": { + "host.name": { + "type": "keyword" + } + } + } + } +} +``` + +Next, an index template is created, referencing two component templates: + +```JSON + "composed_of": ["logs-foo_component1", "logs-foo_component2"] +``` + +Since only the `logs-foo_component1` component template was created previously, the `logs-foo_component2` component template is missing. The following entry is added to the configuration: + +```JSON + "ignore_missing_component_templates": ["logs-foo_component2"], +``` + +The `logs-foo` index template will successfully be created, but it will not validate that `logs-foo_component2` exists: + +```console +PUT _index_template/logs-foo +{ + "index_patterns": ["logs-foo-*"], + "data_stream": { }, + "composed_of": ["logs-foo_component1", "logs-foo_component2"], + "ignore_missing_component_templates": ["logs-foo_component2"], + "priority": 500 +} +``` + +A data stream can be created based on this template: + +```console +PUT _data_stream/logs-foo-bar +``` +The mappings of the data stream will contain the `host.name` field. + +The missing component template can be added later: + +```console +PUT _component_template/logs-foo_component2 +{ + "template": { + "mappings": { + "properties": { + "host.ip": { + "type": "ip" + } + } + } + } +} +``` + +This will not have an immediate effect on the data stream. The mapping `host.ip` will only show up in the data stream mappings when the data stream is rolled over automatically next time or a manual rollover is triggered: + +```console +POST logs-foo-bar/_rollover +``` + diff --git a/manage-data/toc.yml b/manage-data/toc.yml index f25d1871be..26b6f640a5 100644 --- a/manage-data/toc.yml +++ b/manage-data/toc.yml @@ -53,7 +53,7 @@ toc: - file: data-store/templates.md children: - file: data-store/templates/simulate-multi-component-templates.md - - file: data-store/templates/config-ignoremissingcomponenttemplates.md + - file: data-store/templates/ignore-missing-component-templates.md - file: data-store/templates/index-template-management.md - file: data-store/aliases.md - file: data-store/manage-data-from-the-command-line.md diff --git a/raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md b/raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md deleted file mode 100644 index d39c1f2123..0000000000 --- a/raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md +++ /dev/null @@ -1,77 +0,0 @@ -# Usage example [_usage_example] - -In the following, one component template and an index template are created. The index template references two component templates, but only the `@package` one exists. - -Create the component template `logs-foo_component1`. This has to be created before the index template as it is not optional: - -```console -PUT _component_template/logs-foo_component1 -{ - "template": { - "mappings": { - "properties": { - "host.name": { - "type": "keyword" - } - } - } - } -} -``` - -Next, the index template will be created and it references two component templates: - -```JSON - "composed_of": ["logs-foo_component1", "logs-foo_component2"] -``` - -Before, only the `logs-foo_component1` compontent template was created, meaning the `logs-foo_component2` is missing. Because of this the following entry was added to the config: - -```JSON - "ignore_missing_component_templates": ["logs-foo_component2"], -``` - -During creation of the template, it will not validate that `logs-foo_component2` exists: - -```console -PUT _index_template/logs-foo -{ - "index_patterns": ["logs-foo-*"], - "data_stream": { }, - "composed_of": ["logs-foo_component1", "logs-foo_component2"], - "ignore_missing_component_templates": ["logs-foo_component2"], - "priority": 500 -} -``` - -The index template `logs-foo` was successfully created. A data stream can be created based on this template: - -```console -PUT _data_stream/logs-foo-bar -``` - -Looking at the mappings of the data stream, it will contain the `host.name` field. - -At a later stage, the missing component template might be added: - -```console -PUT _component_template/logs-foo_component2 -{ - "template": { - "mappings": { - "properties": { - "host.ip": { - "type": "ip" - } - } - } - } -} -``` - -This will not have an immediate effect on the data stream. The mapping `host.ip` will only show up in the data stream mappings when the data stream is rolled over automatically next time or a manual rollover is triggered: - -```console -POST logs-foo-bar/_rollover -``` - diff --git a/raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md b/raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md deleted file mode 100644 index 433a564a1d..0000000000 --- a/raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md +++ /dev/null @@ -1,5 +0,0 @@ -# Config ignore_missing_component_templates [ignore_missing_component_templates] - -The configuration option `ignore_missing_component_templates` can be used when an index template references a component template that might not exist. Every time a data stream is created based on the index template, the existence of the component template will be checked. If it exists, it will used to form the index’s composite settings. If it does not exist, it is ignored. - - diff --git a/raw-migrated-files/toc.yml b/raw-migrated-files/toc.yml index 0567f0dfcb..e34c939dd1 100644 --- a/raw-migrated-files/toc.yml +++ b/raw-migrated-files/toc.yml @@ -452,7 +452,6 @@ toc: - file: elasticsearch-hadoop/elasticsearch-hadoop/doc-sections.md - file: elasticsearch/elasticsearch-reference/index.md children: - - file: elasticsearch/elasticsearch-reference/_usage_example.md - file: elasticsearch/elasticsearch-reference/active-directory-realm.md - file: elasticsearch/elasticsearch-reference/autoscaling-deciders.md - file: elasticsearch/elasticsearch-reference/autoscaling-fixed-decider.md @@ -480,7 +479,6 @@ toc: - file: elasticsearch/elasticsearch-reference/file-realm.md - file: elasticsearch/elasticsearch-reference/fips-140-compliance.md - file: elasticsearch/elasticsearch-reference/how-monitoring-works.md - - file: elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md - file: elasticsearch/elasticsearch-reference/index-mgmt.md - file: elasticsearch/elasticsearch-reference/index-modules-allocation.md - file: elasticsearch/elasticsearch-reference/index-modules-mapper.md