Is my script correct, To adjust the index policy so that alerts.log files are kept for 31 days until rolled and then deleted after 732d (i.e. 2 years). ? WAZUH-Dashboard
>> Indexer management >> State management policies
>>create policy
{
"policy": {
"policy_id": "wazuh-alert-retention-policy",
"description": "Wazuh alerts retention policy with rollover and 2-year retention",
"last_updated_time": 1730384732979,
"schema_version": 21,
"error_notification": null,
"default_state": "hot",
"states": [
{
"name": "hot",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"rollover": {
"min_index_age": "31d",
"copy_alias": false
}
}
],
"transitions": [
{
"state_name": "cold",
"conditions": {
"min_index_age": "31d"
}
}
]
},
{
"name": "cold",
"actions": [],
"transitions": [
{
"state_name": "delete",
"conditions": {
"min_index_age": "732d"
}
}
]
},
{
"name": "delete",
"actions": [
{
"retry": {
"count": 3,
"backoff": "exponential",
"delay": "1m"
},
"delete": {}
}
],
"transitions": []
}
],
"ism_template": [
{
"index_patterns": [
"wazuh-alerts-*"
],
"priority": 1,
"last_updated_time": 1730384732979
}
]
}
}