-
Notifications
You must be signed in to change notification settings - Fork 163
Add Scenario 4: Apply ILM policy to all data streams in a custom integration #2082
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
2ebccdc
Add new data streams scenario
alexandra5000 862c48c
Remove timestamp, make list consistent
alexandra5000 434a518
Add new file to ToC
alexandra5000 116b6d5
Merge branch 'main' into custom-data-stream
alexandra5000 efead86
Apply comments
alexandra5000 714901e
Merge branch 'main' into custom-data-stream
alexandra5000 5bae54b
Apply final comment
alexandra5000 3eb83be
Merge branch 'custom-data-stream' of github.com:alexandra5000/docs-co…
alexandra5000 e558a4f
Merge branch 'main' into custom-data-stream
alexandra5000 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 `<integration>@custom`, replacing `<integration>` 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. | ||
alexandra5000 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
After the ILM policy from `docker` has been deployed, it applies to all data streams in the package. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.