elastic / elastic/elastic-agent-libs

file.newTriggers does not know about the file being rotated

Open
#78 0 comments 0 reactions 0 assignees View on GitHub
8.6-candidate bug Team:Elastic-Agent-Data-Plane
Dominant language
Go
Stars
6
Forks
57
Avg merge
6d 7h
Merged PRs (30d)
3

Description

The `file.newTriggers` function doesn't take the filename (or it's properties) as an argument. This means that when an intervalTrigger is created, there is no way to populate the `lastRotate` field in the trigger with the creation time of the file. This results in the `lastRotate` field being the zero value for a duration. When the trigger is first executed it will always report that the file needs to be rotated because difference between the zero value and now() will be greater than the interval. This leads to unexpected behavior if `rotateonstartup: false` is set.

Fixes need to be backported to beats repo that have this package internally.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.