Skip to content

Commit c0d949f

Browse files
authored
[Docs] Add Ignore missing component templates page (#496)
Closes [#372](elastic/docs-projects#372) Preview [here]() ### Summary What I changed: - Combined content from the two mapped pages and refined it - Renamed the page to a more user friendly title. Let me know what you think! - Deleted the linked raw migrated files I'll delete code comments after the review
1 parent 189efd7 commit c0d949f

File tree

6 files changed

+100
-103
lines changed

6 files changed

+100
-103
lines changed

manage-data/data-store/templates/config-ignoremissingcomponenttemplates.md

Lines changed: 0 additions & 18 deletions
This file was deleted.
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
---
2+
mapped_urls:
3+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/ignore_missing_component_templates.html
4+
- https://www.elastic.co/guide/en/elasticsearch/reference/current/_usage_example.html
5+
---
6+
7+
# Ignore missing component templates
8+
9+
% What needs to be done: Refine
10+
11+
% GitHub issue: docs-projects#372
12+
13+
% Scope notes: Combine with "Usage example" subpage.
14+
15+
% Use migrated content from existing pages that map to this page:
16+
17+
% - [x] ./raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md
18+
% - [x] ./raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md
19+
20+
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.
21+
22+
The following example demonstrates how this configuration option works.
23+
24+
## Example: Use the `ignore_missing_component_templates` option
25+
26+
In this example, an index template and one component template are created. The index template references two component templates, but only one exists.
27+
28+
Suppose the `logs-foo_component1` component template is created *before* the index template:
29+
30+
```console
31+
PUT _component_template/logs-foo_component1
32+
{
33+
"template": {
34+
"mappings": {
35+
"properties": {
36+
"host.name": {
37+
"type": "keyword"
38+
}
39+
}
40+
}
41+
}
42+
}
43+
```
44+
45+
Next, an index template is created, referencing two component templates:
46+
47+
```JSON
48+
"composed_of": ["logs-foo_component1", "logs-foo_component2"]
49+
```
50+
51+
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:
52+
53+
```JSON
54+
"ignore_missing_component_templates": ["logs-foo_component2"],
55+
```
56+
57+
The `logs-foo` index template will successfully be created, but it will not validate that `logs-foo_component2` exists:
58+
59+
```console
60+
PUT _index_template/logs-foo
61+
{
62+
"index_patterns": ["logs-foo-*"],
63+
"data_stream": { },
64+
"composed_of": ["logs-foo_component1", "logs-foo_component2"],
65+
"ignore_missing_component_templates": ["logs-foo_component2"],
66+
"priority": 500
67+
}
68+
```
69+
70+
A data stream can be created based on this template:
71+
72+
```console
73+
PUT _data_stream/logs-foo-bar
74+
```
75+
The mappings of the data stream will contain the `host.name` field.
76+
77+
The missing component template can be added later:
78+
79+
```console
80+
PUT _component_template/logs-foo_component2
81+
{
82+
"template": {
83+
"mappings": {
84+
"properties": {
85+
"host.ip": {
86+
"type": "ip"
87+
}
88+
}
89+
}
90+
}
91+
}
92+
```
93+
94+
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:
95+
96+
```console
97+
POST logs-foo-bar/_rollover
98+
```
99+

manage-data/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ toc:
5353
- file: data-store/templates.md
5454
children:
5555
- file: data-store/templates/simulate-multi-component-templates.md
56-
- file: data-store/templates/config-ignoremissingcomponenttemplates.md
56+
- file: data-store/templates/ignore-missing-component-templates.md
5757
- file: data-store/templates/index-template-management.md
5858
- file: data-store/aliases.md
5959
- file: data-store/manage-data-from-the-command-line.md

raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md

Lines changed: 0 additions & 77 deletions
This file was deleted.

raw-migrated-files/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

raw-migrated-files/toc.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,6 @@ toc:
452452
- file: elasticsearch-hadoop/elasticsearch-hadoop/doc-sections.md
453453
- file: elasticsearch/elasticsearch-reference/index.md
454454
children:
455-
- file: elasticsearch/elasticsearch-reference/_usage_example.md
456455
- file: elasticsearch/elasticsearch-reference/active-directory-realm.md
457456
- file: elasticsearch/elasticsearch-reference/autoscaling-deciders.md
458457
- file: elasticsearch/elasticsearch-reference/autoscaling-fixed-decider.md
@@ -480,7 +479,6 @@ toc:
480479
- file: elasticsearch/elasticsearch-reference/file-realm.md
481480
- file: elasticsearch/elasticsearch-reference/fips-140-compliance.md
482481
- file: elasticsearch/elasticsearch-reference/how-monitoring-works.md
483-
- file: elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md
484482
- file: elasticsearch/elasticsearch-reference/index-mgmt.md
485483
- file: elasticsearch/elasticsearch-reference/index-modules-allocation.md
486484
- file: elasticsearch/elasticsearch-reference/index-modules-mapper.md

0 commit comments

Comments
 (0)