Can Vector drop old files from the checkpointing? #25461
Replies: 2 comments
-
|
The With 3k files per day, the checkpointer state will keep growing unless you prune it. One approach that works: set If restarts aren't acceptable, you could also set up an external cron job to delete old log files before Vector sees them, combined with |
Beta Was this translation helpful? Give feedback.
-
|
The sources:
my_files:
type: file
include: ["/var/log/batch/*.log"]
remove_after_secs: 86400Vector must be allowed to delete the files for this to work. If the files have to be retained, then there is no runtime pruning and you would pair an external cleanup job with |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
We have a directory structure of log files that we need to monitor. This is from a system that schedules batch jobs, so each batch job drops a file. This ends up being about 3k files per day. The
ignore_older_secsseems to only work on startup to ignore files in the checkpointer.Is there an option or pattern to drop old files? We are on an older version, but I went through the code and don't see how it would drop older files. Without that, I would expect the file handles to continually grow until it runs out.
If this doesn't exist, would this be a useful feature? I'm happy to contribute if others would use the same feature.
Vector Config
No response
Vector Logs
No response
Beta Was this translation helpful? Give feedback.
All reactions