Skip to content

Commit 1cf928c

Browse files
authored
[DOCS] Update ILM docs to use composable index templates (#60323)
1 parent 5e28513 commit 1cf928c

File tree

5 files changed

+61
-52
lines changed

5 files changed

+61
-52
lines changed

docs/reference/ilm/ilm-tutorial.asciidoc

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ as expected.
294294

295295
[discrete]
296296
[[ilm-gs-alias-apply-policy]]
297-
=== Create a legacy index template to apply the lifecycle policy
297+
=== Create an index template to apply the lifecycle policy
298298

299299
To automatically apply a lifecycle policy to the new write index on rollover,
300300
specify the policy in the index template used to create new indices.
@@ -310,24 +310,26 @@ that match the index pattern.
310310
when the rollover action is triggered for an index.
311311

312312
You can use the {kib} Create template wizard to add the template. To access the
313-
wizard, open the menu, go to *Stack Management > Index Management*, and click
314-
the *Index Templates* tab.
313+
wizard, open the menu and go to *Stack Management > Index Management*. In the
314+
the *Index Templates* tab, click *Create template*.
315315

316316
[role="screenshot"]
317-
image:images/ilm/create-template-wizard.png[]
317+
image:images/ilm/create-template-wizard.png[Create template page]
318318

319319
The create template request for the example template looks like this:
320320

321321
[source,console]
322322
-----------------------
323-
PUT _template/timeseries_template
323+
PUT _index_template/timeseries_template
324324
{
325325
"index_patterns": ["timeseries-*"], <1>
326-
"settings": {
327-
"number_of_shards": 1,
328-
"number_of_replicas": 1,
329-
"index.lifecycle.name": "timeseries_policy", <2>
330-
"index.lifecycle.rollover_alias": "timeseries" <3>
326+
"template": {
327+
"settings": {
328+
"number_of_shards": 1,
329+
"number_of_replicas": 1,
330+
"index.lifecycle.name": "timeseries_policy", <2>
331+
"index.lifecycle.rollover_alias": "timeseries" <3>
332+
}
331333
}
332334
}
333335
-----------------------
@@ -342,7 +344,7 @@ Required for policies that use the rollover action.
342344
343345
[source,console]
344346
--------------------------------------------------
345-
DELETE /_template/timeseries_template
347+
DELETE _index_template/timeseries_template
346348
--------------------------------------------------
347349
// TEST[continued]
348350

docs/reference/ilm/ilm-with-existing-indices.asciidoc

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,28 +98,30 @@ to the document ID.
9898
//////////////////////////
9999
[source,console]
100100
-----------------------
101-
PUT _template/mylogs_template
101+
PUT _index_template/mylogs_template
102102
{
103103
"index_patterns": [
104104
"mylogs-*"
105105
],
106-
"settings": {
107-
"number_of_shards": 1,
108-
"number_of_replicas": 1,
109-
"index": {
110-
"lifecycle": {
111-
"name": "mylogs_condensed_policy", <2>
112-
"rollover_alias": "mylogs" <3>
106+
"template": {
107+
"settings": {
108+
"number_of_shards": 1,
109+
"number_of_replicas": 1,
110+
"index": {
111+
"lifecycle": {
112+
"name": "mylogs_condensed_policy", <2>
113+
"rollover_alias": "mylogs" <3>
114+
}
113115
}
114-
}
115-
},
116-
"mappings": {
117-
"properties": {
118-
"message": {
119-
"type": "text"
120-
},
121-
"@timestamp": {
122-
"type": "date"
116+
},
117+
"mappings": {
118+
"properties": {
119+
"message": {
120+
"type": "text"
121+
},
122+
"@timestamp": {
123+
"type": "date"
124+
}
123125
}
124126
}
125127
}
@@ -148,7 +150,7 @@ POST mylogs-pre-ilm-2019.06.25/_doc
148150
149151
[source,console]
150152
--------------------------------------------------
151-
DELETE _template/mylogs_template
153+
DELETE _index_template/mylogs_template
152154
--------------------------------------------------
153155
// TEST[continued]
154156

docs/reference/ilm/set-up-lifecycle-policy.asciidoc

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ To use a policy that triggers the rollover action,
7676
you need to configure the policy in the index template used to create each new index.
7777
You specify the name of the policy and the alias used to reference the rolling indices.
7878

79-
To use the Create template wizard to create a template from {kib} Management,
80-
go to Management, click **Index Management** and select the **Index Templates** view.
79+
You can use the {kib} Create template wizard to create a template. To access the
80+
wizard, open the menu and go to *Stack Management > Index Management*. In the
81+
the *Index Templates* tab, click *Create template*.
8182

8283
[role="screenshot"]
83-
image:images/ilm/create-template-wizard.png[]
84+
image:images/ilm/create-template-wizard-my_template.png[Create template page]
8485

8586
The wizard invokes the <<indices-put-template,put template API>> to add templates to a cluster.
8687

@@ -89,14 +90,16 @@ The wizard invokes the <<indices-put-template,put template API>> to add template
8990
====
9091
[source,console]
9192
-----------------------
92-
PUT _template/my_template
93+
PUT _index_template/my_template
9394
{
9495
"index_patterns": ["test-*"], <1>
95-
"settings": {
96-
"number_of_shards": 1,
97-
"number_of_replicas": 1,
98-
"index.lifecycle.name": "my_policy", <2>
99-
"index.lifecycle.rollover_alias": "test-alias" <3>
96+
"template": {
97+
"settings": {
98+
"number_of_shards": 1,
99+
"number_of_replicas": 1,
100+
"index.lifecycle.name": "my_policy", <2>
101+
"index.lifecycle.rollover_alias": "test-alias" <3>
102+
}
100103
}
101104
}
102105
-----------------------
@@ -109,7 +112,7 @@ PUT _template/my_template
109112
110113
[source,console]
111114
--------------------------------------------------
112-
DELETE /_template/my_template
115+
DELETE _index_template/my_template
113116
--------------------------------------------------
114117
// TEST[continued]
115118
@@ -197,22 +200,24 @@ WARNING: Be careful that you don't inadvertently match indices that you don't wa
197200
//////////////////////////
198201
[source,console]
199202
-----------------------
200-
PUT _template/mylogs_template
203+
PUT _index_template/mylogs_template
201204
{
202205
"index_patterns": [
203206
"mylogs-*"
204207
],
205-
"settings": {
206-
"number_of_shards": 1,
207-
"number_of_replicas": 1
208-
},
209-
"mappings": {
210-
"properties": {
211-
"message": {
212-
"type": "text"
213-
},
214-
"@timestamp": {
215-
"type": "date"
208+
"template": {
209+
"settings": {
210+
"number_of_shards": 1,
211+
"number_of_replicas": 1
212+
},
213+
"mappings": {
214+
"properties": {
215+
"message": {
216+
"type": "text"
217+
},
218+
"@timestamp": {
219+
"type": "date"
220+
}
216221
}
217222
}
218223
}
@@ -241,7 +246,7 @@ POST mylogs-pre-ilm-2019.06.25/_doc
241246
242247
[source,console]
243248
--------------------------------------------------
244-
DELETE _template/mylogs_template
249+
DELETE _index_template/mylogs_template
245250
--------------------------------------------------
246251
// TEST[continued]
247252
41.4 KB
Loading
-145 KB
Loading

0 commit comments

Comments
 (0)