Skip to content

Commit 14ea007

Browse files
authored
[DOCS] Update priority recommendation for index templates (#69006)
1 parent 6f02a9b commit 14ea007

File tree

4 files changed

+24
-20
lines changed

4 files changed

+24
-20
lines changed

docs/reference/cat/templates.asciidoc

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,18 +55,18 @@ include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=cat-v]
5555
----
5656
GET _cat/templates/my-template-*?v=true&s=name
5757
----
58-
// TEST[s/^/PUT _index_template\/my-template-0\n{"index_patterns": "te*", "priority": 200}\n/]
59-
// TEST[s/^/PUT _index_template\/my-template-1\n{"index_patterns": "tea*", "priority": 201}\n/]
60-
// TEST[s/^/PUT _index_template\/my-template-2\n{"index_patterns": "teak*", "priority": 202, "version": 7}\n/]
58+
// TEST[s/^/PUT _index_template\/my-template-0\n{"index_patterns": "te*", "priority": 500}\n/]
59+
// TEST[s/^/PUT _index_template\/my-template-1\n{"index_patterns": "tea*", "priority": 501}\n/]
60+
// TEST[s/^/PUT _index_template\/my-template-2\n{"index_patterns": "teak*", "priority": 502, "version": 7}\n/]
6161

6262
The API returns the following response:
6363

6464
[source,txt]
6565
----
6666
name index_patterns order version composed_of
67-
my-template-0 [te*] 200 []
68-
my-template-1 [tea*] 201 []
69-
my-template-2 [teak*] 202 7 []
67+
my-template-0 [te*] 500 []
68+
my-template-1 [tea*] 501 []
69+
my-template-2 [teak*] 502 7 []
7070
----
7171
// TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ non_json]
7272

docs/reference/data-streams/change-mappings-and-settings.asciidoc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ PUT /_index_template/my-data-stream-template
102102
{
103103
"index_patterns": [ "my-data-stream*" ],
104104
"data_stream": { },
105-
"priority": 200,
105+
"priority": 500,
106106
"template": {
107107
"mappings": {
108108
"properties": {
@@ -185,7 +185,7 @@ PUT /_index_template/my-data-stream-template
185185
{
186186
"index_patterns": [ "my-data-stream*" ],
187187
"data_stream": { },
188-
"priority": 200,
188+
"priority": 500,
189189
"template": {
190190
"mappings": {
191191
"properties": {
@@ -290,7 +290,7 @@ PUT /_index_template/my-data-stream-template
290290
{
291291
"index_patterns": [ "my-data-stream*" ],
292292
"data_stream": { },
293-
"priority": 200,
293+
"priority": 500,
294294
"template": {
295295
"settings": {
296296
"index.refresh_interval": "30s" <1>
@@ -344,7 +344,7 @@ PUT /_index_template/my-data-stream-template
344344
{
345345
"index_patterns": [ "my-data-stream*" ],
346346
"data_stream": { },
347-
"priority": 200,
347+
"priority": 500,
348348
"template": {
349349
"settings": {
350350
"sort.field": [ "@timestamp"], <1>
@@ -446,7 +446,7 @@ PUT /_index_template/new-data-stream-template
446446
{
447447
"index_patterns": [ "new-data-stream*" ],
448448
"data_stream": { },
449-
"priority": 200,
449+
"priority": 500,
450450
"template": {
451451
"mappings": {
452452
"properties": {

docs/reference/data-streams/set-up-a-data-stream.asciidoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ PUT /_index_template/my-data-stream-template
139139
{
140140
"index_patterns": [ "my-data-stream*" ],
141141
"data_stream": { },
142-
"priority": 200,
142+
"priority": 500,
143143
"template": {
144144
"settings": {
145145
"index.lifecycle.name": "my-data-stream-policy"

docs/reference/indices/index-templates.asciidoc

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,20 +33,24 @@ following index patterns:
3333
// end::built-in-index-template-patterns[]
3434
3535
The {fleet-guide}/fleet-overview.html[{agent}] uses these templates to create
36-
data streams. If you use the {agent}, assign your index templates a priority
37-
lower than `100` to avoid overriding the built-in templates. Otherwise, to avoid
38-
accidentally applying the built-in templates, do one or more of the following:
36+
data streams. Index templates created by {fleet} integrations use similar
37+
overlapping index patterns and have a priority up to `200`.
38+
39+
If you use {fleet} or the {agent}, assign your index templates a priority
40+
lower than `100` to avoid overriding these templates. Otherwise, to avoid
41+
accidentally applying the templates, do one or more of the following:
3942
4043
- To disable all built-index index and component templates, set
4144
<<stack-templates-enabled,`stack.templates.enabled`>> to `false` using the
4245
<<cluster-update-settings,cluster update settings API>>.
4346
4447
- Use a non-overlapping index pattern.
4548
46-
- Assign templates with an overlapping pattern a `priority` higher than `100`.
47-
For example, if you don't use the {agent} and want to create a template for the
48-
`logs-*` index pattern, assign your template a priority of `200`. This ensures
49-
your template is applied instead of the built-in template for `logs-*-*`.
49+
- Assign templates with an overlapping pattern a `priority` higher than `200`.
50+
For example, if you don't use {fleet} or the {agent} and want to create a
51+
template for the `logs-*` index pattern, assign your template a priority of
52+
`500`. This ensures your template is applied instead of the built-in template
53+
for `logs-*-*`.
5054
====
5155
// end::built-in-index-templates[]
5256

@@ -110,7 +114,7 @@ PUT _index_template/template_1
110114
"mydata": { }
111115
}
112116
},
113-
"priority": 200,
117+
"priority": 500,
114118
"composed_of": ["component_template1", "other_component_template"],
115119
"version": 3,
116120
"_meta": {

0 commit comments

Comments
 (0)