Apply an ILM policy to all data streams in a custom integration
Elastic Cloud Serverless projects are autoscaled environments, fully managed by Elastic and available on Elastic Cloud. Availability This functionality is not available in Elastic Cloud Serverless. The Elastic Stack includes Elastic's core products such as Elasticsearch, Kibana, Logstash, and Beats. Availability This functionality is generally available and ready for production usage. Unless stated otherwise on the page, this functionality is available when your Elastic Stack is deployed on Elastic Cloud Hosted, Elastic Cloud Enterprise, Elastic Cloud on Kubernetes, and self-managed environments. This documentation corresponds to the latest patch available for each minor version. If you're not using the latest patch, check the release notes for changes.
Serverless
Unavailable
Unavailable
Stack
9.1+
Generally available since 9.1
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.
- In Kibana, go to the Index Lifecycle Policies management page. You can also use the global search field.
- Click Create policy.
- Name the policy, configure it as needed, and click Save policy.
Create a custom component template named <integration>@custom, replacing <integration> with your package name.
For example, for a Docker integration, use:
PUT _component_template/docker@custom
{
"template": {
"settings": {
"index": {
"lifecycle": {
"name": "docker-ilm-policy"
}
}
},
"mappings": {
"properties":
}
}
}
}
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.