Hi
avkby445h 24,
You should check which files are consuming the most.
You will find logs of 3 types:
- Wazuh logs: Logs that record the status of Wazuh and the actions carried out.
- Event logs (archives): Logs that record all the events received by the wazuh-server.
- Alert logs (alerts): Logs that record all alerts generated by the wazuh-server
Here are some measures you can apply:
- If Wazuh logs fill your disk: You probably have some kind of DEBUG enabled, which causes many logs per second. If yes and not necessary, then proceed to disable them from 'var/ossec/etc/local_internal_options.conf' or '/var/ossec/etc/internal_options.conf'.
- If event logging (archives) fills up your disk: By default, this logging is disabled but can be enabled by the user for debugging issues or specific use cases. It serves to log all the events received by the wazuh-server, so in case you have many agents or even a few agents reporting many events per second, it fills the disk quite fast. You can check if you have it enabled by checking 'logall' and 'logall_json' in your '/var/ossec/etc/ossec.conf' file. In case it is active, and you don't need it, disable it and restart the service.
- If logging alerts (alerts) fill your disk: In this case, you can apply some retention policy to delete old logs, or delete the logs you are not interested in.
I believe that for your case, a cron job to make a backup and delete old files should solve the problem.
Here is an example of a cron job that deletes logs older than 7 days, you could combine it with your script running in your Windows Server to first create the backup and then use the cron job to delete logs older than a week:
0 0 * * * find /var/ossec/logs/alerts/ -type f -mtime +7 -exec rm -f {} \;
0 0 * * * find /var/ossec/logs/archives/ -type f -mtime +7 -exec rm -f {} \;