Skip to content

Commit fa9975f

Browse files
Add Scenario 4: Apply ILM policy to all data streams in a custom integration (elastic#2082)
Added a new ILM configuration scenario to the Fleet data streams documentation (Scenario 4: Apply an ILM policy to all data streams in a custom integration). Applies to version 9.1 and later
1 parent f29e7b5 commit fa9975f

File tree

3 files changed

+61
-1
lines changed

3 files changed

+61
-1
lines changed

reference/fleet/data-streams-ilm-tutorial.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ How you apply an ILM policy depends on your use case. Choose a scenario for the
2626

2727
* **[Scenario 1](/reference/fleet/data-streams-scenario1.md)**: You want to apply an ILM policy to all logs or metrics data streams across all namespaces.
2828
* **[Scenario 2](/reference/fleet/data-streams-scenario2.md)**: You want to apply an ILM policy to selected data streams in an integration.
29-
* **[Scenario 3](/reference/fleet/data-streams-scenario3.md)**: You want apply an ILM policy for data streams in a selected namespace in an integration.
29+
* **[Scenario 3](/reference/fleet/data-streams-scenario3.md)**: You want to apply an ILM policy for data streams in a selected namespace in an integration.
30+
* **[Scenario 4](/reference/fleet/data-streams-scenario4.md)**: You want to apply an ILM policy to all data streams in a custom integration using a `@custom` component template. {applies_to}`stack: ga 9.1`
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
navigation_title: Scenario 4
3+
mapped_pages:
4+
- https://www.elastic.co/guide/en/fleet/current/data-streams-scenario4.html
5+
products:
6+
- id: fleet
7+
- id: elastic-agent
8+
applies_to:
9+
stack: ga 9.1
10+
serverless: ga
11+
---
12+
13+
# Scenario 4: Apply an ILM policy to all data streams in a custom integration [data-streams-scenario4]
14+
15+
If you’ve created a custom integration package, you can apply a single ILM policy to all its data streams using a shared `@custom` component template. This eliminates the need to configure each data stream individually.
16+
17+
## Step 1: Define the ILM policy [data-streams-scenario4-step1]
18+
19+
1. In {{kib}}, go to **Stack Management** and select **Index Lifecycle Policies**. You can also use the [global search field](/get-started/the-stack.md#kibana-navigation-search).
20+
2. Click **Create policy**.
21+
3. Name the policy, configure it as needed, and click **Save policy**.
22+
23+
## Step 2: Create a custom component template [data-streams-scenario4-step2]
24+
25+
Create a custom component template named `<integration>@custom`, replacing `<integration>` with your package name.
26+
27+
For example, for a Docker integration, use:
28+
29+
```json
30+
PUT _component_template/docker@custom
31+
{
32+
"template": {
33+
"settings": {
34+
"index": {
35+
"lifecycle": {
36+
"name": "docker-ilm-policy"
37+
}
38+
}
39+
},
40+
"mappings": {
41+
"properties":
42+
}
43+
}
44+
}
45+
}
46+
```
47+
48+
## Step 3: Deploy or update the integration [data-streams-scenario4-step3]
49+
50+
The `@custom` component template is automatically included when the package is installed or updated.
51+
52+
To apply the ILM policy:
53+
54+
- Bump the version of your custom package.
55+
56+
- Reinstall or upgrade the package using the {{fleet}} UI or Developer Console.
57+
58+
After the ILM policy from `docker` has been deployed, it applies to all data streams in the package.

reference/fleet/toc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ toc:
151151
- file: data-streams-scenario1.md
152152
- file: data-streams-scenario2.md
153153
- file: data-streams-scenario3.md
154+
- file: data-streams-scenario4.md
154155
- file: data-streams-pipeline-tutorial.md
155156
- file: data-streams-advanced-features.md
156157
- file: agent-command-reference.md

0 commit comments

Comments
 (0)