Skip to content

Commit 48c0664

Browse files
committed
Add UI steps to 'Update existing data stream' tutorial
1 parent efddf25 commit 48c0664

File tree

3 files changed

+72
-7
lines changed

3 files changed

+72
-7
lines changed
113 KB
Loading
120 KB
Loading

manage-data/lifecycle/data-stream/tutorial-update-existing-data-stream.md

Lines changed: 72 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,37 @@ products:
1010

1111
# Tutorial: Update existing data stream [tutorial-manage-existing-data-stream]
1212

13-
To update the lifecycle of an existing data stream you do the following actions:
13+
To update the lifecycle of an existing data stream you need to perform the following actions:
1414

1515
1. [Set a data stream’s lifecycle](#set-lifecycle)
1616
2. [Remove lifecycle for a data stream](#delete-lifecycle)
1717

1818

1919
## Set a data stream’s lifecycle [set-lifecycle]
2020

21-
To add or to change the retention period of your data stream you can use the [PUT lifecycle API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle).
21+
To add or to change the retention period of your data stream you can use **Index Management** in {{kib}} or the {{es}} [PUT lifecycle API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-data-lifecycle).
22+
23+
24+
:::::{tab-set}
25+
:group: kibana-api
26+
:::{tab-item} {{kib}}
27+
:sync: kibana
28+
29+
To change the data retention settings for a data stream:
30+
31+
1. Go to **Stack Management > Index Management** and open the **Data Streams** tab.
32+
1. Use the search tool to find the data stream you're looking for.
33+
1. Select the data stream to view details.
34+
1. In the data stream details pane, select **Manage > Edit data retention** to adjust the settings. You can do any of the following:
35+
. Select the duration that your data should be retained, in days, hours, minutes, or seconds.
36+
. Choose to **Keep data indefinitely**, so that your data will not be deleted.
37+
. Disable **Enable data retention** to turn off data stream lifecycle management for your data stream.
38+
:::
39+
40+
:::{tab-item} API
41+
:sync: api
42+
43+
To change the data retention settings for a data stream:
2244

2345
* You can set infinite retention period, meaning that your data should never be deleted. For example:
2446

@@ -39,9 +61,31 @@ To add or to change the retention period of your data stream you can use the [PU
3961
```
4062

4163
1. The retention period of this data stream is set to 30 days. This means that {{es}} is allowed to delete data that is older than 30 days at its own discretion.
64+
:::
65+
:::::
66+
67+
The changes in the lifecycle are applied on all backing indices of the data stream.
68+
69+
You can see the effect of the change in {{kib}} or using the {{es}} [explain API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle):
70+
71+
:::::{tab-set}
72+
:group: kibana-api
73+
:::{tab-item} {{kib}}
74+
:sync: kibana
75+
To check the data retention settings for a data stream:
76+
77+
1. Go to **Stack Management > Index Management** and open the **Data Streams** tab.
78+
1. Use the search tool to find the data stream you're looking for.
79+
1. Select the data stream to view details. The flyout shows the data retention settings for the data stream. Note that if the data stream is currently managed by an [{{ilm-init}} policy](/manage-data/lifecycle/index-lifecycle-management.md), the **Effective data retention** may differ from the retention value that you've set in the data stream, as indicated by the **Data retention**.
4280

81+
![Index lifecycle status page](/manage-data/images/elasticsearch-reference-lifecycle-status.png "")
4382

44-
The changes in the lifecycle are applied on all backing indices of the data stream. You can see the effect of the change via the [explain API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle):
83+
:::
84+
85+
:::{tab-item} API
86+
:sync: api
87+
88+
To check the data retention settings for a data stream:
4589

4690
```console
4791
GET .ds-my-data-stream-*/_lifecycle/explain
@@ -90,16 +134,37 @@ The response will look like:
90134
9. The time that will be used to determine when it’s safe to delete this index and all its data.
91135
10. The data retention for this index as well is at least 30 days, as it was recently updated.
92136

93-
137+
:::
138+
:::::
94139

95140
## Remove lifecycle for a data stream [delete-lifecycle]
96141

97-
To remove the lifecycle of a data stream you can use the [delete lifecycle API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-lifecycle). As consequence, the maintenance operations that were applied by the lifecycle will no longer be applied to the data stream and all its backing indices. For example:
142+
To remove the lifecycle of a data stream you can use in {{kib}} or the {{es}} [delete lifecycle API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-delete-data-lifecycle).
143+
144+
145+
:::::{tab-set}
146+
:group: kibana-api
147+
:::{tab-item} {{kib}}
148+
:sync: kibana
149+
1. Go to **Stack Management > Index Management** and open the **Data Streams** tab.
150+
1. Use the search tool to find the data stream you're looking for.
151+
1. Select the data stream to view details.
152+
1. In the data stream details pane, select **Manage > Edit data retention**.
153+
1. Turn off the **Enable data retention** option and save your changes. The maintenance operations that were applied by the lifecycle will no longer be applied to the data stream and all of its backing indices.
154+
You can confirm your changes by reopening the data stream pane. The **Effective data retention** will show a **Disabled** status.
98155

156+
![Index lifecycle status is disabled](/manage-data/images/elasticsearch-reference-lifecycle-disabled.png "")
157+
158+
:::
159+
160+
:::{tab-item} API
161+
:sync: api
99162
```console
100163
DELETE _data_stream/my-data-stream/_lifecycle
101164
```
102165

166+
After running the API request, the maintenance operations that were applied by the lifecycle will no longer be applied to the data stream and all of its backing indices.
167+
103168
You can then use the [explain API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-explain-data-lifecycle) again to see that the indices are no longer managed.
104169

105170
```console
@@ -125,5 +190,5 @@ GET .ds-my-data-stream-*/_lifecycle/explain
125190
2. Indication that the index is not managed by the data stream lifecycle.
126191
3. The name of another backing index.
127192
4. Indication that the index is not managed by the data stream lifecycle.
128-
129-
193+
:::
194+
:::::

0 commit comments

Comments
 (0)