From 0a127f2eba35fd3a6afd63d374a76e1a75368d3b Mon Sep 17 00:00:00 2001 From: Vlada Chirmicci Date: Fri, 22 Aug 2025 17:36:49 +0100 Subject: [PATCH 1/3] Adding links to related pages There are no details about the default ILM policy settings or index template options in the Rollover tutorial, so I'm adding them as these topics are relevant to expore. I'm also adding a link to the page about viewing the lifecycle of an existing index or data stream into the tutorial. Fixes #1562 --- .../tutorial-automate-rollover.md | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md index 5335f842e2..03992c0c78 100644 --- a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md +++ b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md @@ -9,7 +9,7 @@ products: # Tutorial: Automate rollover [getting-started-index-lifecycle-management] -When you continuously index timestamped documents into {{es}}, you typically use a [data stream](../../data-store/data-streams.md) so you can periodically [roll over](rollover.md) to a new index. This enables you to implement a [hot-warm-cold architecture](../data-tiers.md) to meet your performance requirements for your newest data, control costs over time, enforce retention policies, and still get the most out of your data. +When you continuously index timestamped documents into {{es}}, you typically use a [data stream](../../data-store/data-streams.md) so you can periodically [roll over](rollover.md) to a new index. This enables you to implement a [hot-warm-cold architecture](../data-tiers.md) to meet the performance requirements for your newest data, control costs over time, enforce retention policies, and still get the most out of your data. To simplify index management and automate rollover, select one of the scenarios that best applies to your situation: @@ -36,7 +36,7 @@ When you enable {{ilm}} for {{beats}} or the {{ls}} {{es}} output plugin, lifecy A lifecycle policy specifies the phases in the index lifecycle and the actions to perform in each phase. A lifecycle can have up to five phases: `hot`, `warm`, `cold`, `frozen`, and `delete`. -For example, you might define a `timeseries_policy` that has two phases: +For example, you might define a policy named `timeseries_policy` that has the following two phases: * A `hot` phase that defines a rollover action to specify that an index rolls over when it reaches either a `max_primary_shard_size` of 50 gigabytes or a `max_age` of 30 days. * A `delete` phase that sets `min_age` to remove the index 90 days after rollover. @@ -87,19 +87,22 @@ PUT _ilm/policy/timeseries_policy :::: +:::{tip} +For more details about default {{ilm-init}} policy settings, refer to [Create a lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#ilm-create-policy). +::: ### Create an index template to create the data stream and apply the lifecycle policy [ilm-gs-apply-policy] To set up a data stream, first create an index template to specify the lifecycle policy. Because the template is for a data stream, it must also include a `data_stream` definition. -For example, you might create a `timeseries_template` to use for a future data stream named `timeseries`. +For example, you might create a template named `timeseries_template` and use for a future data stream named `timeseries`. -To enable the {{ilm-init}} to manage the data stream, the template configures one {{ilm-init}} setting: +To enable {{ilm-init}} to manage the data stream, the template configures one {{ilm-init}} setting: -* `index.lifecycle.name` specifies the name of the lifecycle policy to apply to the data stream. +* `index.lifecycle.name` specifies the name of the lifecycle policy that you want to apply to the data stream. -You can use the {{kib}} Create template wizard to add the template. From Kibana, open the menu and go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. +You can use the {{kib}} **Create template** wizard to add the template. From {{kib}}, open the menu and go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. :::{image} /manage-data/images/elasticsearch-reference-create-index-template.png :alt: Create template page @@ -107,6 +110,10 @@ You can use the {{kib}} Create template wizard to add the template. From Kibana, This wizard invokes the [create or update index template API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) to create the index template with the options you specify. +:::{tip} +For more information about the available index template options that you can specify, refer to [Create an index template to apply the lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). +::: + ::::{dropdown} API example ```console PUT _index_template/timeseries_template @@ -155,7 +162,7 @@ This process repeats each time a rollover condition is met. You can search acros ### Check lifecycle progress [ilm-gs-check-progress] -To get status information for managed indices, you use the {{ilm-init}} explain API. This lets you find out things like: +To get status information for managed indices, you can use {{kib}} to [view their current status, including details about the ILM policy](/manage-data/lifecycle/index-lifecycle-management/policy-view-status.md) or the {{ilm-init}} explain API. This lets you find out things like: * What phase an index is in and when it entered that phase. * The current action and what step is being performed. @@ -421,6 +428,8 @@ Create a data stream using the [_data_stream API](https://www.elastic.co/docs/ap PUT /_data_stream/movetods ``` +You can [view the lifecycle status of your data stream](/manage-data/lifecycle/index-lifecycle-management/policy-view-status.md), including details about its associated ILM policy. + ### Optional: Reindex your data with a data stream [manage-general-content-with-data-streams-reindex] If you want to copy your documents from an existing index to the data stream you created, reindex with a data stream using the [_reindex API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-reindex): From 7726b8e92455c0a70efc2735b9af30b368564d1f Mon Sep 17 00:00:00 2001 From: Vlada Chirmicci Date: Mon, 25 Aug 2025 10:15:41 +0100 Subject: [PATCH 2/3] Add tabs to contrast the Kibana examples from the API requests --- .../tutorial-automate-rollover.md | 56 ++++++++++++++----- 1 file changed, 43 insertions(+), 13 deletions(-) diff --git a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md index 03992c0c78..d5679b6a87 100644 --- a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md +++ b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md @@ -47,14 +47,24 @@ The `min_age` value is relative to the rollover time, not the index creation tim :::: -You can create the policy through {{kib}} or with the [create or update policy](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle) API. To create the policy from {{kib}}, open the menu and go to **Stack Management > Index Lifecycle Policies**. Click **Create policy**. +You can create the policy in {{kib}} or with the [create or update policy](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle) API. + +::::{tab-set} +:group: kibana-api +:::{tab-item} {{kib}} +:sync: kibana +To create the policy from {{kib}}, open the menu and go to **Stack Management > Index Lifecycle Policies**. Click **Create policy**. :::{image} /manage-data/images/elasticsearch-reference-create-policy.png :alt: Create policy page :screenshot: ::: +::: + +:::{tab-item} API +:sync: api +Use the [Create or update policy](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-ilm-put-lifecycle) API to add an ILM policy to the {{es}} cluster: -::::{dropdown} API example ```console PUT _ilm/policy/timeseries_policy { @@ -84,7 +94,7 @@ PUT _ilm/policy/timeseries_policy 3. Move the index into the `delete` phase 90 days after rollover. 4. Trigger the `delete` action when the index enters the delete phase. - +::: :::: :::{tip} @@ -102,19 +112,27 @@ To enable {{ilm-init}} to manage the data stream, the template configures one {{ * `index.lifecycle.name` specifies the name of the lifecycle policy that you want to apply to the data stream. -You can use the {{kib}} **Create template** wizard to add the template. From {{kib}}, open the menu and go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. +You can use the {{kib}} **Create template** wizard to add the template or the [Create or update index template](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) API to add an index template to a cluster and apply the lifecycle policy to indices matching the template. -:::{image} /manage-data/images/elasticsearch-reference-create-index-template.png -:alt: Create template page -::: +::::{tab-set} +:group: kibana-api +:::{tab-item} {{kib}} +:sync: kibana +To add an index template to a cluster, go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. -This wizard invokes the [create or update index template API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) to create the index template with the options you specify. +![Create template page](/manage-data/images/elasticsearch-reference-create-index-template.png "") -:::{tip} +This wizard invokes the create or update index template API to create the index template with the options you specify. + +:::{tip} For more information about the available index template options that you can specify, refer to [Create an index template to apply the lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). ::: +::: + +:::{tab-item} API +:sync: api +Use the API to add an index template to your cluster: -::::{dropdown} API example ```console PUT _index_template/timeseries_template { @@ -133,7 +151,7 @@ PUT _index_template/timeseries_template 1. Apply the template when a document is indexed into the `timeseries` target. 2. The name of the {{ilm-init}} policy used to manage the data stream. - +::: :::: @@ -245,10 +263,21 @@ To enable automatic rollover, the template configures two {{ilm-init}} settings: * `index.lifecycle.name` specifies the name of the lifecycle policy to apply to new indices that match the index pattern. * `index.lifecycle.rollover_alias` specifies the index alias to be rolled over when the rollover action is triggered for an index. -You can use the {{kib}} Create template wizard to add the template. To access the wizard, open the menu and go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. +::::{tab-set} +:group: kibana-api +:::{tab-item} {{kib}} +:sync: kibana +To use the {{kib}} **Create template** wizard to add the template, go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. ![Create template page](/manage-data/images/elasticsearch-reference-create-template-wizard.png "") +:::{tip} +For more information about the available index template options that you can specify, refer to [Create an index template to apply the lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). +::: +::: + +:::{tab-item} API +:sync: api The create template request for the example template looks like this: ```console @@ -270,7 +299,8 @@ PUT _index_template/timeseries_template 2. The name of the lifecycle policy to apply to each new index. 3. The name of the alias used to reference these indices. Required for policies that use the rollover action. - +::: +:::: ### Bootstrap the initial time series index with a write index alias [ilm-gs-alias-bootstrap] From 077c09a242789fc3ccb59ef510a027cec80de0c3 Mon Sep 17 00:00:00 2001 From: Vlada Chirmicci Date: Tue, 26 Aug 2025 11:06:24 +0100 Subject: [PATCH 3/3] Edits post peer review --- .../tutorial-automate-rollover.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md index d5679b6a87..0e56f007b3 100644 --- a/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md +++ b/manage-data/lifecycle/index-lifecycle-management/tutorial-automate-rollover.md @@ -106,26 +106,26 @@ For more details about default {{ilm-init}} policy settings, refer to [Create a To set up a data stream, first create an index template to specify the lifecycle policy. Because the template is for a data stream, it must also include a `data_stream` definition. -For example, you might create a template named `timeseries_template` and use for a future data stream named `timeseries`. +For example, you might create a template named `timeseries_template` and use it for a future data stream named `timeseries`. To enable {{ilm-init}} to manage the data stream, the template configures one {{ilm-init}} setting: * `index.lifecycle.name` specifies the name of the lifecycle policy that you want to apply to the data stream. -You can use the {{kib}} **Create template** wizard to add the template or the [Create or update index template](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) API to add an index template to a cluster and apply the lifecycle policy to indices matching the template. +Use the {{kib}} **Create template** wizard to add a template or the [Create or update index template](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) API to add a template and apply the lifecycle policy to indices matching the template. ::::{tab-set} :group: kibana-api :::{tab-item} {{kib}} :sync: kibana -To add an index template to a cluster, go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. +To add an index template to a cluster using the wizard, go to **Stack Management > Index Management**. In the **Index Templates** tab, click **Create template**. ![Create template page](/manage-data/images/elasticsearch-reference-create-index-template.png "") This wizard invokes the create or update index template API to create the index template with the options you specify. :::{tip} -For more information about the available index template options that you can specify, refer to [Create an index template to apply the lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). +To learn about which index template options you can specify, refer to [Create an index template to apply the lifecycle policy](/manage-data/lifecycle/index-lifecycle-management/configure-lifecycle-policy.md#apply-policy-template). ::: ::: @@ -180,7 +180,7 @@ This process repeats each time a rollover condition is met. You can search acros ### Check lifecycle progress [ilm-gs-check-progress] -To get status information for managed indices, you can use {{kib}} to [view their current status, including details about the ILM policy](/manage-data/lifecycle/index-lifecycle-management/policy-view-status.md) or the {{ilm-init}} explain API. This lets you find out things like: +Use {{kib}} to [view the current status of your managed indices](/manage-data/lifecycle/index-lifecycle-management/policy-view-status.md) and details about the ILM policy, or the {{ilm-init}} explain API. Find out things like: * What phase an index is in and when it entered that phase. * The current action and what step is being performed.