From 2ebccdc106e573c86bbb7227fc8da461f4d9ed87 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Wed, 9 Jul 2025 14:37:55 +0200 Subject: [PATCH 1/5] Add new data streams scenario --- reference/fleet/data-streams-ilm-tutorial.md | 3 +- reference/fleet/data-streams-scenario4.md | 62 ++++++++++++++++++++ 2 files changed, 64 insertions(+), 1 deletion(-) create mode 100644 reference/fleet/data-streams-scenario4.md diff --git a/reference/fleet/data-streams-ilm-tutorial.md b/reference/fleet/data-streams-ilm-tutorial.md index 25b3e7a261..c567f80ed9 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)** (9.1+): Apply an ILM policy to all data streams in a custom integration using a `@custom` component template. \ 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..f1acf075d9 --- /dev/null +++ b/reference/fleet/data-streams-scenario4.md @@ -0,0 +1,62 @@ +--- +navigation_title: Scenario 4 +mapped_pages: + - https://www.elastic.co/guide/en/fleet/current/data-streams-scenario4.html +products: + - id: fleet + - id: elastic-agent +--- + +# 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. + +:::{note} +This method is available in version 9.1 and later. +::: + +## 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": { + "@timestamp": { + "type": "date" + } + } + } + } +} +``` + +## 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 it has been deployed, the ILM policy from `docker@custom` will apply to all data streams in the package. \ No newline at end of file From 862c48c7afff15b1353efe357a20f4542280ef83 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Wed, 9 Jul 2025 16:01:42 +0200 Subject: [PATCH 2/5] Remove timestamp, make list consistent --- reference/fleet/data-streams-ilm-tutorial.md | 2 +- reference/fleet/data-streams-scenario4.md | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/reference/fleet/data-streams-ilm-tutorial.md b/reference/fleet/data-streams-ilm-tutorial.md index c567f80ed9..5cae6d9baf 100644 --- a/reference/fleet/data-streams-ilm-tutorial.md +++ b/reference/fleet/data-streams-ilm-tutorial.md @@ -27,4 +27,4 @@ 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 to apply an ILM policy for data streams in a selected namespace in an integration. -* **[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. \ No newline at end of file +* **[Scenario 4](/reference/fleet/data-streams-scenario4.md)** (9.1+): You want to apply an ILM policy to all data streams in a custom integration using a `@custom` component template. \ No newline at end of file diff --git a/reference/fleet/data-streams-scenario4.md b/reference/fleet/data-streams-scenario4.md index f1acf075d9..7b63300806 100644 --- a/reference/fleet/data-streams-scenario4.md +++ b/reference/fleet/data-streams-scenario4.md @@ -39,10 +39,7 @@ PUT _component_template/docker@custom } }, "mappings": { - "properties": { - "@timestamp": { - "type": "date" - } + "properties": } } } From 434a518ad86391e3457a924945e20ad641f153d8 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Wed, 9 Jul 2025 16:11:24 +0200 Subject: [PATCH 3/5] Add new file to ToC --- reference/fleet/toc.yml | 1 + 1 file changed, 1 insertion(+) 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 From efead868e10d079b16847adca532e3ab3426d309 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Thu, 10 Jul 2025 11:22:07 +0200 Subject: [PATCH 4/5] Apply comments --- reference/fleet/data-streams-ilm-tutorial.md | 2 +- reference/fleet/data-streams-scenario4.md | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/reference/fleet/data-streams-ilm-tutorial.md b/reference/fleet/data-streams-ilm-tutorial.md index 5cae6d9baf..f4e293e3c2 100644 --- a/reference/fleet/data-streams-ilm-tutorial.md +++ b/reference/fleet/data-streams-ilm-tutorial.md @@ -27,4 +27,4 @@ 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 to apply an ILM policy for data streams in a selected namespace in an integration. -* **[Scenario 4](/reference/fleet/data-streams-scenario4.md)** (9.1+): You want to apply an ILM policy to all data streams in a custom integration using a `@custom` component template. \ No newline at end of file +* **[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 index 7b63300806..7f2f2479e9 100644 --- a/reference/fleet/data-streams-scenario4.md +++ b/reference/fleet/data-streams-scenario4.md @@ -5,16 +5,15 @@ mapped_pages: 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. -:::{note} -This method is available in version 9.1 and later. -::: - ## 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). @@ -56,4 +55,4 @@ To apply the ILM policy: - Reinstall or upgrade the package using the Fleet UI or Developer Console. -After it has been deployed, the ILM policy from `docker@custom` will apply to all data streams in the package. \ No newline at end of file +After the ILM policy from `docker` has been deployed, it applies to all data streams in the package. \ No newline at end of file From 5bae54be3b6749236d05f525e4730ed2647276e3 Mon Sep 17 00:00:00 2001 From: Aleksandra Spilkowska Date: Thu, 10 Jul 2025 17:37:36 +0200 Subject: [PATCH 5/5] Apply final comment --- reference/fleet/data-streams-scenario4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reference/fleet/data-streams-scenario4.md b/reference/fleet/data-streams-scenario4.md index 7f2f2479e9..c78c12db2c 100644 --- a/reference/fleet/data-streams-scenario4.md +++ b/reference/fleet/data-streams-scenario4.md @@ -53,6 +53,6 @@ To apply the ILM policy: - Bump the version of your custom package. -- Reinstall or upgrade the package using the Fleet UI or Developer Console. +- 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