Skip to content

Commit 2ebccdc

Browse files
committed
Add new data streams scenario
1 parent 6469c34 commit 2ebccdc

File tree

2 files changed

+64
-1
lines changed

2 files changed

+64
-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)** (9.1+): Apply an ILM policy to all data streams in a custom integration using a `@custom` component template.
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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+
---
9+
10+
# Scenario 4: Apply an ILM policy to all data streams in a custom integration [data-streams-scenario4]
11+
12+
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.
13+
14+
:::{note}
15+
This method is available in version 9.1 and later.
16+
:::
17+
18+
## Step 1: Define the ILM policy [data-streams-scenario4-step1]
19+
20+
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).
21+
2. Click **Create policy**.
22+
3. Name the policy, configure it as needed, and click **Save policy**.
23+
24+
## Step 2: Create a custom component template [data-streams-scenario4-step2]
25+
26+
Create a custom component template named `<integration>@custom`, replacing `<integration>` with your package name.
27+
28+
For example, for a Docker integration, use:
29+
30+
```json
31+
PUT _component_template/docker@custom
32+
{
33+
"template": {
34+
"settings": {
35+
"index": {
36+
"lifecycle": {
37+
"name": "docker-ilm-policy"
38+
}
39+
}
40+
},
41+
"mappings": {
42+
"properties": {
43+
"@timestamp": {
44+
"type": "date"
45+
}
46+
}
47+
}
48+
}
49+
}
50+
```
51+
52+
## Step 3: Deploy or update the integration [data-streams-scenario4-step3]
53+
54+
The `@custom` component template is automatically included when the package is installed or updated.
55+
56+
To apply the ILM policy:
57+
58+
- Bump the version of your custom package.
59+
60+
- Reinstall or upgrade the package using the Fleet UI or Developer Console.
61+
62+
After it has been deployed, the ILM policy from `docker@custom` will apply to all data streams in the package.

0 commit comments

Comments
 (0)