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
In the ILM docs, the [Customize built-in
policies](https://www.elastic.co/docs/manage-data/lifecycle/index-lifecycle-management/tutorial-customize-built-in-policies#example-using-index-lifecycle-policy-apply-policy)
tutorial mentions `@custom` component templates with a "learn more" link
that points to the "Create or update component template" API docs. Not
super helpful, since those API docs don't mention the `@custom`
component templates.
Those templates are discussed in more detail in the Fleet docs, with
lengthy examples of using them. This PR adds a link to that content and
removes the API link.
I've also added a sentence at the top giving an example of creating a
custom policy for K8s logs, since we're told that those can be giant.
Closes: elastic#1557
---------
Co-authored-by: Edu González de la Herrán <[email protected]>
Copy file name to clipboardExpand all lines: manage-data/lifecycle/index-lifecycle-management/tutorial-customize-built-in-policies.md
+20-3Lines changed: 20 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,6 +11,8 @@ products:
11
11
12
12
{{es}} includes a set of built-in {{ilm-init}} policies that govern how managed indices transition as they age. This guide demonstrates how you can customize the lifecycle of a managed index, to adjust how the index transitions across [data tiers](/manage-data/lifecycle/data-tiers.md) and what [actions](/manage-data/lifecycle/index-lifecycle-management/index-lifecycle.md#ilm-phase-actions), such as downsampling or shrinking, are performed on the index during each lifecycle phase.
13
13
14
+
Setting a custom {{ilm-init}} policy is useful when you have a specific set of indices, for example a set of Kubernetes logs which can grow to be quite large in volume, for which you don't want to use the default data retention duration and other {{ilm-init}} settings.
15
+
14
16
[{{agent}}](/reference/fleet/index.md) uses the following set of built-in {{ilm-init}} policies to manage backing indices for its data streams:
15
17
16
18
*`logs@lifecycle`
@@ -27,9 +29,11 @@ This tutorial covers customizing the way ingested logging data is managed. Rathe
27
29
3.[Apply the new policy to your log data using a `logs@custom` component template](#example-using-index-lifecycle-policy-apply-policy).
28
30
29
31
:::{tip}
30
-
If you're using [Elastic integrations](https://docs.elastic.co/en/integrations) and are not yet familiar with which data streams are associated with them, refer to [Manage the lifecycle policy for integrations data](/manage-data/lifecycle/index-lifecycle-management/manage-lifecycle-integrations-data.md).
32
+
* If you're using [Elastic integrations](https://docs.elastic.co/en/integrations) and are not yet familiar with which data streams are associated with them, refer to [Manage the lifecycle policy for integrations data](/manage-data/lifecycle/index-lifecycle-management/manage-lifecycle-integrations-data.md).
33
+
34
+
* If you're looking for a more advanced use case, such as customizing an ILM policy for a selected set of data streams in one or more integrations or namespaces, check the set of tutorials in [Customize data retention policies](/reference/fleet/data-streams-ilm-tutorial.md) in the {{fleet}} and {{agent}} reference documentation.
31
35
32
-
If you're looking for a more advanced use case, such as customizing an ILM policy for a selected set of data streams in one or more integrations or namespaces, check the set of tutorials in [Customize data retention policies](/reference/fleet/data-streams-ilm-tutorial.md)in the {{fleet}} and {{agent}} reference documentation.
36
+
These tutorials go into greater depth about creating and using `@custom` component templates. For example, the tutorial [Apply an ILM policy to all data streams generated from {{fleet}} integrations across all namespaces](/reference/fleet/data-streams-scenario1.md)shows how to create and use the `logs@custom` and `metrics@custom` component templates to customize {{ilm-init}} policies associated with data streams in integrations.
@@ -140,7 +144,20 @@ Copies of managed {{ilm-init}} policies are also marked as **Managed**. You can
140
144
141
145
To apply your new {{ilm-init}} policy to the `logs` index template, create or edit the `logs@custom` component template.
142
146
143
-
A `*@custom` component template allows you to customize the mappings and settings of managed index templates, without having to override managed index templates or component templates. This type of component template is automatically picked up by the index template. [Learn more](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-cluster-put-component-template).
147
+
148
+
:::::{admonition} Using @custom component templates
149
+
A `@custom` component template allows you to customize the mappings and settings of the managed index templates, without having to override them or their main component templates.
150
+
151
+
Many {{es}} managed index templates include one or more `@custom` component templates. A `@custom` component template must first be created before it can be used, and its name must exactly match the name specified in the managed index template in order to be applied automatically to indices as they're created.
152
+
153
+
For example, if you're ingesting OpenTelemetry (OTel) logs, any OTel log data streams and their backing indices are configured by the `logs-otel@template` managed index template. That index template automatically applies settings defined in the `logs@custom` and the `logs-otel@custom` template when they exist.
154
+
155
+
Go to **Index Management > Index Templates** and select any managed index to view the `@custom` component templates associated with it.
:alt: A screenshot showing the logs@custom and logs-otel@custom component templates associated with the logs-otel@template index template.
159
+
:::
160
+
:::::
144
161
145
162
:::{tip}
146
163
If you want your {{ilm-init}} changes to apply only to specific indices, you can create a custom index template directly instead of modifying the custom component template. Use the **Index management** page in {{kib}} or the [index template](https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-indices-put-index-template) API to create a new template.
0 commit comments