-
Notifications
You must be signed in to change notification settings - Fork 156
[Docs] Add Ignore missing component templates page #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
wajihaparvez
merged 2 commits into
elastic:main
from
wajihaparvez:372/missing-component-templates
Feb 19, 2025
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
manage-data/data-store/templates/config-ignoremissingcomponenttemplates.md
This file was deleted.
Oops, something went wrong.
99 changes: 99 additions & 0 deletions
99
manage-data/data-store/templates/ignore-missing-component-templates.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
``` | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
77 changes: 0 additions & 77 deletions
77
raw-migrated-files/elasticsearch/elasticsearch-reference/_usage_example.md
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
...les/elasticsearch/elasticsearch-reference/ignore_missing_component_templates.md
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfectly good. Just one suggestion: We often aim to address the user directly with active sentences. e.g., "You can use the abc configuration option..." I wouldn't bother changing it in this case, but I noticed it a couple of times in your PRs so just wanted to mention it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @kilfoyle! For this sentence specifically, the old page phrased it this way and I wasn't 100% sure that this configuration option is something a user can directly implement. But I'll remember for next time!