|
@@ -76,11 +76,12 @@ To use a policy that triggers the rollover action,
|
|
|
you need to configure the policy in the index template used to create each new index.
|
|
|
You specify the name of the policy and the alias used to reference the rolling indices.
|
|
|
|
|
|
-To use the Create template wizard to create a template from {kib} Management,
|
|
|
-go to Management, click **Index Management** and select the **Index Templates** view.
|
|
|
+You can use the {kib} Create template wizard to create a template. To access the
|
|
|
+wizard, open the menu and go to *Stack Management > Index Management*. In the
|
|
|
+the *Index Templates* tab, click *Create template*.
|
|
|
|
|
|
[role="screenshot"]
|
|
|
-image:images/ilm/create-template-wizard.png[]
|
|
|
+image:images/ilm/create-template-wizard-my_template.png[Create template page]
|
|
|
|
|
|
The wizard invokes the <<indices-put-template,put template API>> to add templates to a cluster.
|
|
|
|
|
@@ -89,14 +90,16 @@ The wizard invokes the <<indices-put-template,put template API>> to add template
|
|
|
====
|
|
|
[source,console]
|
|
|
-----------------------
|
|
|
-PUT _template/my_template
|
|
|
+PUT _index_template/my_template
|
|
|
{
|
|
|
"index_patterns": ["test-*"], <1>
|
|
|
- "settings": {
|
|
|
- "number_of_shards": 1,
|
|
|
- "number_of_replicas": 1,
|
|
|
- "index.lifecycle.name": "my_policy", <2>
|
|
|
- "index.lifecycle.rollover_alias": "test-alias" <3>
|
|
|
+ "template": {
|
|
|
+ "settings": {
|
|
|
+ "number_of_shards": 1,
|
|
|
+ "number_of_replicas": 1,
|
|
|
+ "index.lifecycle.name": "my_policy", <2>
|
|
|
+ "index.lifecycle.rollover_alias": "test-alias" <3>
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
-----------------------
|
|
@@ -109,7 +112,7 @@ PUT _template/my_template
|
|
|
|
|
|
[source,console]
|
|
|
--------------------------------------------------
|
|
|
-DELETE /_template/my_template
|
|
|
+DELETE _index_template/my_template
|
|
|
--------------------------------------------------
|
|
|
// TEST[continued]
|
|
|
|
|
@@ -197,22 +200,24 @@ WARNING: Be careful that you don't inadvertently match indices that you don't wa
|
|
|
//////////////////////////
|
|
|
[source,console]
|
|
|
-----------------------
|
|
|
-PUT _template/mylogs_template
|
|
|
+PUT _index_template/mylogs_template
|
|
|
{
|
|
|
"index_patterns": [
|
|
|
"mylogs-*"
|
|
|
],
|
|
|
- "settings": {
|
|
|
- "number_of_shards": 1,
|
|
|
- "number_of_replicas": 1
|
|
|
- },
|
|
|
- "mappings": {
|
|
|
- "properties": {
|
|
|
- "message": {
|
|
|
- "type": "text"
|
|
|
- },
|
|
|
- "@timestamp": {
|
|
|
- "type": "date"
|
|
|
+ "template": {
|
|
|
+ "settings": {
|
|
|
+ "number_of_shards": 1,
|
|
|
+ "number_of_replicas": 1
|
|
|
+ },
|
|
|
+ "mappings": {
|
|
|
+ "properties": {
|
|
|
+ "message": {
|
|
|
+ "type": "text"
|
|
|
+ },
|
|
|
+ "@timestamp": {
|
|
|
+ "type": "date"
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -241,7 +246,7 @@ POST mylogs-pre-ilm-2019.06.25/_doc
|
|
|
|
|
|
[source,console]
|
|
|
--------------------------------------------------
|
|
|
-DELETE _template/mylogs_template
|
|
|
+DELETE _index_template/mylogs_template
|
|
|
--------------------------------------------------
|
|
|
// TEST[continued]
|
|
|
|