Index retention patterns
Learn to set index retention patterns and manage maximum indices in your Aiven for OpenSearch® instance.
Index retention patterns are a legacy approach for capping the number of indices that match a name pattern, from before Index State Management (ISM) was available on Aiven for OpenSearch. Use ISM instead for any index you're setting up now. For more information, see Index lifecycle management.
Set index retention patterns
To define index retention policies for your OpenSearch indices:
- Console
- API
- Log in to the Aiven Console, select your project, and select your Aiven for OpenSearch service.
- In the Data section, click Indexes. The Indexes section lists the patterns that are currently in use.
- Click Add pattern.
- Enter the pattern to use and the maximum index count for the pattern.
- Click Create.
Alternatively, you can use the API with a request similar to the following:
curl -X PUT --data '{
"user_config": {
"index_patterns": [
{"pattern": "logs*", "max_index_count": 2},
{"pattern": "test.?", "max_index_count": 3}
]
}
}' \
--header "content-type: application/json" \
--header "authorization: aivenv1 <YOUR TOKEN HERE>" \
https://api.aiven.io/v1beta/project/<project>/service/<service_name>
Parameters:
<project>: Your Aiven project name.<service_name>: Name of your Aiven for OpenSearch service.
Related pages