diff --git a/reference/fleet/data-streams-ilm-tutorial.md b/reference/fleet/data-streams-ilm-tutorial.md index 25b3e7a261..f4e293e3c2 100644 --- a/reference/fleet/data-streams-ilm-tutorial.md +++ b/reference/fleet/data-streams-ilm-tutorial.md @@ -26,4 +26,5 @@ How you apply an ILM policy depends on your use case. Choose a scenario for the * **[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. * **[Scenario 2](/reference/fleet/data-streams-scenario2.md)**: You want to apply an ILM policy to selected data streams in an integration. -* **[Scenario 3](/reference/fleet/data-streams-scenario3.md)**: You want apply an ILM policy for data streams in a selected namespace in an integration. +* **[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. +* **[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` \ No newline at end of file diff --git a/reference/fleet/data-streams-scenario4.md b/reference/fleet/data-streams-scenario4.md new file mode 100644 index 0000000000..c78c12db2c --- /dev/null +++ b/reference/fleet/data-streams-scenario4.md @@ -0,0 +1,58 @@ +--- +navigation_title: Scenario 4 +mapped_pages: + - https://www.elastic.co/guide/en/fleet/current/data-streams-scenario4.html +products: + - id: fleet + - id: elastic-agent +applies_to: + stack: ga 9.1 + serverless: ga +--- + +# Scenario 4: Apply an ILM policy to all data streams in a custom integration [data-streams-scenario4] + +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. + +## Step 1: Define the ILM policy [data-streams-scenario4-step1] + +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). +2. Click **Create policy**. +3. Name the policy, configure it as needed, and click **Save policy**. + +## Step 2: Create a custom component template [data-streams-scenario4-step2] + +Create a custom component template named `@custom`, replacing `` with your package name. + +For example, for a Docker integration, use: + +```json +PUT _component_template/docker@custom +{ + "template": { + "settings": { + "index": { + "lifecycle": { + "name": "docker-ilm-policy" + } + } + }, + "mappings": { + "properties": + } + } + } +} +``` + +## Step 3: Deploy or update the integration [data-streams-scenario4-step3] + +The `@custom` component template is automatically included when the package is installed or updated. + +To apply the ILM policy: + +- Bump the version of your custom package. + +- Reinstall or upgrade the package using the {{fleet}} UI or Developer Console. + +After the ILM policy from `docker` has been deployed, it applies to all data streams in the package. \ No newline at end of file diff --git a/reference/fleet/toc.yml b/reference/fleet/toc.yml index bb32917cee..9e9b954302 100644 --- a/reference/fleet/toc.yml +++ b/reference/fleet/toc.yml @@ -151,6 +151,7 @@ toc: - file: data-streams-scenario1.md - file: data-streams-scenario2.md - file: data-streams-scenario3.md + - file: data-streams-scenario4.md - file: data-streams-pipeline-tutorial.md - file: data-streams-advanced-features.md - file: agent-command-reference.md