You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.[Create an index template](#create-index-template)
18
18
4.[Create the data stream](#create-data-stream)
@@ -30,8 +30,11 @@ For {{fleet}} and {{agent}}, refer to [](/reference/fleet/data-streams.md). For
30
30
31
31
32
32
## Create an index lifecycle policy [create-index-lifecycle-policy]
33
+
```{applies_to}
34
+
serverless: unavailable
35
+
```
33
36
34
-
While optional, we recommend using {{ilm-init}} to automate the management of your data stream’s backing indices. {{ilm-init}} requires an index lifecycle policy.
37
+
While optional, we recommend using the index lifecycle management ({{ilm-init}}) capability to automate the management of your data stream’s backing indices. {{ilm-init}} requires an index lifecycle policy.
35
38
36
39
To create an index lifecycle policy in {{kib}}:
37
40
@@ -90,6 +93,9 @@ PUT _ilm/policy/my-lifecycle-policy
90
93
}
91
94
```
92
95
96
+
:::{admonition} Simpler lifecycle management in {{serverless-short}} projects
97
+
{{ilm-init}} lets you automatically transition indices through data tiers according to your performance needs and retention requirements. This allows you to balance hardware costs with performance. {{ilm-init}} is not available in {{serverless-short}} because in that environment your cluster performance is optimized for you. Instead, [data stream lifecycle](/manage-data/lifecycle/data-stream.md) is available as a data management option.
@@ -112,10 +118,15 @@ To create a component template in {{kib}}:
112
118
1. Go to the **Index Management** page using the navigation menu or the [global search field](/explore-analyze/find-and-organize/find-apps-and-objects.md).
113
119
1. In the **Index Templates** tab, click **Create component template**.
114
120
115
-
You can also use the [create component template API](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template).
121
+
You can also use the [create component template](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template) API for {{stack}} or the [create or update a component template](https://www.elastic.co/docs/api/doc/elasticsearch-serverless/operation/operation-cluster-put-component-template) API for {{serverless-full}}.
122
+
123
+
::::{tab-set}
124
+
125
+
:::{tab-item} {{stack}}
126
+
:sync: stack
127
+
To create a component template for mappings, use this query:
116
128
117
129
```console
118
-
# Creates a component template for mappings
119
130
PUT _component_template/my-mappings
120
131
{
121
132
"template": {
@@ -136,8 +147,11 @@ PUT _component_template/my-mappings
136
147
"my-custom-meta-field": "More arbitrary metadata"
137
148
}
138
149
}
150
+
```
139
151
140
-
# Creates a component template for index settings
152
+
To create a component template for index settings, use this query:
153
+
154
+
```console
141
155
PUT _component_template/my-settings
142
156
{
143
157
"template": {
@@ -152,6 +166,39 @@ PUT _component_template/my-settings
152
166
}
153
167
```
154
168
169
+
:::
170
+
171
+
:::{tab-item} {{serverless-short}}
172
+
:sync: serverless
173
+
To create a component template, use this query:
174
+
175
+
```console
176
+
PUT _component_template/template_1
177
+
{
178
+
"template": {
179
+
"settings": {
180
+
"number_of_shards": 1
181
+
},
182
+
"mappings": {
183
+
"_source": {
184
+
"enabled": false
185
+
},
186
+
"properties": {
187
+
"host_name": {
188
+
"type": "keyword"
189
+
},
190
+
"created_at": {
191
+
"type": "date",
192
+
"format": "EEE MMM dd HH:mm:ss Z yyyy"
193
+
}
194
+
}
195
+
}
196
+
}
197
+
}
198
+
```
199
+
200
+
:::
201
+
::::
155
202
156
203
## Create an index template [create-index-template]
157
204
@@ -220,6 +267,9 @@ For an example, see [Data stream privileges](../../../deploy-manage/users-roles/
220
267
221
268
222
269
## Convert an index alias to a data stream [convert-index-alias-to-data-stream]
270
+
```{applies_to}
271
+
serverless: unavailable
272
+
```
223
273
224
274
Prior to {{es}} 7.9, you’d typically use an [index alias with a write index](../../lifecycle/index-lifecycle-management/tutorial-time-series-without-data-streams.md) to manage time series data. Data streams replace this functionality, require less maintenance, and automatically integrate with [data tiers](../../lifecycle/data-tiers.md).
0 commit comments