I am using a centralised server (CS) where I rsync the logs from all applications every 5 minutes. I use filebeat on the centralised server to send logs to elastic search.
Issue I face is that the log on my hosts rotate after 1GB and hence it almost gets rotated every hour. When I rsync the same I face issue that on the CS that there is no log rotation done here.
For eg: p1dm.log is the filename which gets rotated to p1dm-data-timestamp.log after 1 hour and then new p1dm.log is created.
On my CS rsync will collect logs and it already has a p1dm.log file which is continuously being written to. Once the new p1dm.log gets created on my hosts, will it still continue to write in my same p1dm.log file on CS server. If yes then that file will get huge . Any suggestions on what can I do so that my rsync syncs files along with logrotation.
Thanks in advance for help.