Hi again George,
I am sorry for the late reply, I had to ask the team about this issue. Unfortunately, recovering the alerts from the archives is not a trivial task.
First of all, I would recommend you to backup every log file again, including the new installation ones. To do so, be sure to save the whole /var/ossec/logs/ directory.
Then, in your (old) backup archives directory, you should have such files and some subdirectories containing compressed old archives files, we will only care about the json files. To fully restore the previous alerts you should uncompress all the *.json.gz compressed files. This can be done by using the gzip command:
# gzip -dvk FileName.json.gz
(you can replace “FileName” with “*” on every directory to uncompress all the json files)
After having all the uncompressed old archives files, you should stop the manager and then dump the contents of the json files, in order, to the alerts.json file. But you should only dump the logs with an alert level equal to or higher than the alert level you have set on your manager’s ossec.conf file. To get such logs, you can use the egrep tool as follows:
# egrep "(\"level\":[3-9])|(\"level\":[1][0-6])" FileName.json
(To dump the output please use the >> operator pointing to the new alerts.json file)
After completing the alerts dumping you can start your manager again.
If you have the time and the patience, I would suggest doing this process once for every json file (stop the manager, dump alerts from a single file, start the manager, check the alerts on Kibana and repeat).
Please, let us know if you have any doubt related to this process
--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/c1782676-4a4a-48e4-a2ba-26872c543c6cn%40googlegroups.com.
|
|
