Hi Jonathan,
Sorry for the late response.
I have tested the ILM-rollover configuration using the Wazuh 3.13.1 version. Use wazuh-alerts-4.x instead of wazuh-alerts-3.x if you are using Wazuh 4.0 version.
1. Create the ILM policy with rollover enabled

Change the values to suit your needs
After creating the ILM policy, do not add the policy to an index template using Kibana and neither use the Index Management tool to add it to your indices.
Instead, we are going to modify the Filebeat configuration files so we do not lose the setup when restarting Filebeat.
2. Update the wazuh template
We need to add the following settings in the /etc/filebeat/wazuh-template.json file:
In my case it looks like follows:
head -n 10 /etc/filebeat/wazuh-template.json
{
"order": 0,
"index_patterns": [
"wazuh-alerts-3.x-*",
"wazuh-archives-3.x-*"
],
"settings": {
"index.lifecycle.name": "wazuh-alert-retention-policy",
"index.lifecycle.rollover_alias": "wazuh-alerts-3.x",
3. Modify the /etc/filebeat/filebeat.yml file, adding or updating the following lines:
setup.ilm.enabled: true
setup.ilm.policy_name: "<policy_name>"
setup.ilm.rollover_alias: "<rollover_alias_name>"
In my case the /etc/filebeat/filebeat.yml file looks like this:
# Wazuh - Filebeat configuration file
filebeat.modules:
- module: wazuh
alerts:
enabled: true
archives:
enabled: false
setup.template.json.enabled: true
setup.template.json.path: '/etc/filebeat/wazuh-template.json'
setup.template.json.name: 'wazuh'
setup.template.overwrite: true
setup.ilm.enabled: true
setup.ilm.policy_name: "wazuh-alert-retention-policy"
setup.ilm.rollover_alias: "wazuh-alerts-3.x"
output.elasticsearch.hosts: ['http://localhost:9200']
4. Delete the following block from the /usr/share/filebeat/module/wazuh/alerts/ingest/pipeline.json file:
{
"date_index_name": {
"field": "timestamp",
"date_rounding": "d",
"index_name_prefix": "{{fields.index_prefix}}",
"index_name_format": "yyyy.MM.dd",
"ignore_failure": false
}
},
5. Use the following command to reload the ingest pipeline
filebeat setup --pipelines --modules wazuh
6. Restart the Filebeat service
The ILM with rollover enabled is already configured. When new alerts are received, a new index with the following format <alias_name>-<yyyy.MM.dd>-000001 will be created.
For instance:
curl http://localhost:9200/_cat/indices/wazuh-alerts-3.x*?s=index
green open wazuh-alerts-3.x-2020.11.04 n1dAHY9-QTuLGsfX6HRHwA 3 0 9 0 88.2kb 88.2kb
green open wazuh-alerts-3.x-2020.11.04-000001 6kFCDr9sQa-luq3yrKYxwA 3 0 5 0 36.5kb 36.5kb
alias index filter routing.index routing.search is_write_index
wazuh-alerts-3.x wazuh-alerts-3.x-2020.11.04-000001 - - - true
This index will roll over to a new index based on the rollover conditions.
I hope it helps. Let me know if you have any questions.
Best regards,
Mayte Ariza