Click Add state to create a state for index deletion. Enter a name such as delete_alerts.
Click Add action and select Delete in the Action type. Click Add action. Then click Save state.
Click Add state again to create an initial state. Enter a name, such as initial.
Choose Add before from the Order tab and select delete_alerts.
Click Add transition and select delete_alerts as the Destination state.
Select Minimum Index Age in Condition. Input the retention value, for example, 90d for 90 days, in the Minimum Index Age.
Click Add transition. Click Save state. Click Create.
Hi!
You're absolutely right about the issue with the Visual editor steps in the Wazuh documentation. The main problem is that the deletion state is incorrectly presented as the initial state, which causes the indices to be deleted constantly. As moosemaimer mentioned, the initial state should not be set to deletion right away.
I strongly recommend using the JSON editor instead, as the steps are clearer and function correctly. The key difference is that the JSON guide correctly sets up a retention state first. This retention state ensures that the indices remain until they meet the specified conditions (like reaching a certain age), and only then do they transition to the deletion state.
To resolve this issue, you should delete the current ISM policy and reconfigure it using the JSON editor. Start by creating a retention state where the policy waits for the indices to meet the age condition. Once that condition is met, the policy can then move to the deletion state.
If you need any assistance in configuring the policy this way, feel free to reach out—I'm here to help!
