I'm using Filebeat on windows server.
I write logs from my applications to the following path format:
I need to have the ability to delete old log files. I don't want my drive to run out of storage every couple months.
What would be the best way to do it?
Currently, my idea is to have a script (Powershell probably) that runs once a day and searches in the path
C:\AppLogs\**\*.txt for logs files that are older than
Today (By comparing the current date with the name of the file). It looks for the candidate file names in the Filebeat registry to see if the offset is equal to the size of the file, if so, it deletes the file.
Is it a good idea? Or is it some other tool that will do it automatically?
Is there something the Filebeat has out of the box?