Skip to content
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

[DOCS] Update priority recommendation for index templates #69006

Merged
merged 2 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions docs/reference/cat/templates.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
----
GET _cat/templates/my-template-*?v=true&s=name
----
// TEST[s/^/PUT _index_template\/my-template-0\n{"index_patterns": "te*", "priority": 200}\n/]
// TEST[s/^/PUT _index_template\/my-template-1\n{"index_patterns": "tea*", "priority": 201}\n/]
// TEST[s/^/PUT _index_template\/my-template-2\n{"index_patterns": "teak*", "priority": 202, "version": 7}\n/]
// TEST[s/^/PUT _index_template\/my-template-0\n{"index_patterns": "te*", "priority": 500}\n/]
// TEST[s/^/PUT _index_template\/my-template-1\n{"index_patterns": "tea*", "priority": 501}\n/]
// TEST[s/^/PUT _index_template\/my-template-2\n{"index_patterns": "teak*", "priority": 502, "version": 7}\n/]

The API returns the following response:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ PUT /_index_template/my-data-stream-template
{
"index_patterns": [ "my-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"mappings": {
"properties": {
Expand Down Expand Up @@ -185,7 +185,7 @@ PUT /_index_template/my-data-stream-template
{
"index_patterns": [ "my-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"mappings": {
"properties": {
Expand Down Expand Up @@ -290,7 +290,7 @@ PUT /_index_template/my-data-stream-template
{
"index_patterns": [ "my-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"settings": {
"index.refresh_interval": "30s" <1>
Expand Down Expand Up @@ -344,7 +344,7 @@ PUT /_index_template/my-data-stream-template
{
"index_patterns": [ "my-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"settings": {
"sort.field": [ "@timestamp"], <1>
Expand Down Expand Up @@ -446,7 +446,7 @@ PUT /_index_template/new-data-stream-template
{
"index_patterns": [ "new-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"mappings": {
"properties": {
Expand Down
2 changes: 1 addition & 1 deletion docs/reference/data-streams/set-up-a-data-stream.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ PUT /_index_template/my-data-stream-template
{
"index_patterns": [ "my-data-stream*" ],
"data_stream": { },
"priority": 200,
"priority": 500,
"template": {
"settings": {
"index.lifecycle.name": "my-data-stream-policy"
Expand Down
20 changes: 12 additions & 8 deletions docs/reference/indices/index-templates.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,24 @@ following index patterns:
// end::built-in-index-template-patterns[]

The {fleet-guide}/fleet-overview.html[{agent}] uses these templates to create
data streams. If you use the {agent}, assign your index templates a priority
lower than `100` to avoid overriding the built-in templates. Otherwise, to avoid
accidentally applying the built-in templates, do one or more of the following:
data streams. Index templates created by {fleet} integrations use similar
overlapping index patterns and have a priority up to `200`.

If you use {fleet} or the {agent}, assign your index templates a priority
lower than `100` to avoid overriding these templates. Otherwise, to avoid
accidentally applying the templates, do one or more of the following:

- To disable all built-index index and component templates, set
<<stack-templates-enabled,`stack.templates.enabled`>> to `false` using the
<<cluster-update-settings,cluster update settings API>>.

- Use a non-overlapping index pattern.

- Assign templates with an overlapping pattern a `priority` higher than `100`.
For example, if you don't use the {agent} and want to create a template for the
`logs-*` index pattern, assign your template a priority of `200`. This ensures
your template is applied instead of the built-in template for `logs-*-*`.
- Assign templates with an overlapping pattern a `priority` higher than `200`.
For example, if you don't use {fleet} or the {agent} and want to create a
template for the `logs-*` index pattern, assign your template a priority of
`500`. This ensures your template is applied instead of the built-in template
for `logs-*-*`.
====
// end::built-in-index-templates[]

Expand Down Expand Up @@ -110,7 +114,7 @@ PUT _index_template/template_1
"mydata": { }
}
},
"priority": 200,
"priority": 500,
"composed_of": ["component_template1", "other_component_template"],
"version": 3,
"_meta": {
Expand Down