Hello.
To create a lifecycle policy to manage the indexes, you could follow this documentation that explains exactly what you want to achieve:
https://wazuh.com/blog/wazuh-index-management/I recommend you to follow the steps given in the "OpenDistro ISM" part as the Wazuh dashboard is a customization of OpenSearch Dashboards.
I hope it helps you.
Best regards from the Wazuh team.