Hi jonh,
If you want to upscale your existing deployment to cluster by adding a new node to it. Follow this document.
https://documentation.wazuh.com/current/user-manual/wazuh-server-cluster/adding-new-server-nodes/index.html
If you want to do a completely new deployment you can follow this.
You can copy the logs from the Wazuh alerts and archives folder to your new environment where you have cluster setup and reinject the log to your indexer to create indices for those logs and show them on the dashboard
/var/ossec/logs/alerts/
/var/ossec/logs/archives/
You need to follow this document for this:
https://wazuh.com/blog/recover-your-data-using-wazuh-alert-backups/
The script will reinject the log to your indexer using the .json.gz logs
The script will look for the logs in this format for alert logs.
alert_file = "{0}logs/alerts/{1}/{2}/ossec-alerts-{3:02}.json.gz".format
Meaning /logs/alerts/Year/Mon/ossec-alerts-date.json.gz
You need to modify that line if you want to restore the archives logs.
Please keep in mind that this restored log will not show in the Wazuh Dashboards, meaning threat hunting, FIM, and SCA events if you are moving from a single manager setup to a cluster.
Your old logs do not have this information cluster name, but it is necessary to have it in a cluster setup to show these logs in the Dashboard. Because of this sticky filter cluster.name
Which is manager.name in the deployment where there is no cluster.
You will still be able to see those old alerts in Discover
The only way to see these logs in the dashboard is to add this field name to each alert one by one, which is not a practical method.
We can change the manager name using the API tool per document but cannot change it in bulk
For this go to Indexer management > Dev tool
POST /wazuh-alerts-4.x-2024.06.03/_update/<Document_ID>
{
"doc" : {
"cluster": {
"name": "<cluster_name>"
}
}
}