Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
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.

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.

Copy link
Contributor Author

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!


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
```

2 changes: 1 addition & 1 deletion manage-data/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

This file was deleted.

This file was deleted.

2 changes: 0 additions & 2 deletions raw-migrated-files/toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Loading