Hi Julio,
Thanks a lot for your reply! Actually, the steps mentioned in the documents has become more clear now with your notes! So thanks a lot!
Just need to add something that may other people find helpful. The case mentioned in the document is about recovering lost alerts from 'wazuh-alerts-*' index. In my situation, I needed to recover lost alerts from 'wazuh-archives-*' index. So that, I had to modify two parameters:
1-The alert_file parameter within the recovery.py script from alert_file = "{0}logs/alerts/{1}/{2}/ossec-alerts-{3:02}.json.gz".format(wazuh_path,current_time.year,month_dict[current_time.month],current_time.day) as in the document to alert_file = "{0}logs/archives/{1}/{2}/ossec-archive-{3:02}.json.gz".format(wazuh_path,current_time.year,month_dict[current_time.month],current_time.day). Notice the yellow-highleted changes.
2- for the yaml file to be edited for filebeat service to start alert indexing from recovery.json, I had to edit the file /usr/share/filebeat/module/wazuh/archives/manifest.yml, instead.
and in my wazuh server the file looked like this
____________________________________________________
module_version: 0.1
var:
- name: paths
default:
- /var/ossec/logs/archives/archives.json
- /tmp/recovery.json
- name: index_prefix
default: wazuh-archives-4.x-
input: config/archives.yml
ingest_pipeline: ingest/pipeline.json
_____________________________________________________
Now after applying the two modifications, to make it match my requirements, and taking into accounts the notes illustrated from your side and the shared documentation I was able to recover the lost alerts to the index wazuh-archives-4.x-2022.12.13 successfully as you can see below .
Thanks a lot Julio!! I really appreciate your support!
Regards,
Bilal