-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduction of close_older #718
Conversation
@@ -15,7 +15,8 @@ import ( | |||
// Defaults for config variables which are not set | |||
const ( | |||
DefaultRegistryFile = ".filebeat" | |||
DefaultIgnoreOlderDuration time.Duration = 24 * time.Hour | |||
DefaultIgnoreOlderDuration time.Duration = 72 * time.Hour |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@urso I suggest to change the default to inifinite (which would be 0). WDYT? Including also @guyboertje (see https://github.com/logstash-plugins/logstash-input-file/pull/87/files#r49697378)
68886de
to
f186aa8
Compare
// This ensures we don't skip genuine creations with dead times less than 10s | ||
if h.Stat.Fileinfo.ModTime().Before(p.lastscan) && | ||
// If ignore_older is disable (by beeing 0) this never gets true | ||
if h.Stat.Fileinfo.ModTime().Before(p.lastscan) && p.config.IgnoreOlderDuration != 0 && | ||
time.Since(h.Stat.Fileinfo.ModTime()) > p.config.IgnoreOlderDuration { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's a long unreadable expression
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I move it into a separate function. Still more cleanup needed (later ...)
LGTM |
@@ -21,6 +21,7 @@ https://github.com/elastic/beats/compare/1.0.0...master[Check the HEAD diff] | |||
- Rename proc.cpu.user_p with proc.cpu.total_p as includes CPU time spent in kernel space {pull}631[631] | |||
|
|||
*Filebeat* | |||
- Default config for ignore_older is now inifit instead of 24h, means ignore_older is disabled by default. Use close_older to only close file handlers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo, s/infinit/infinite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
LGTM apart from the small comments above. |
…ssues/181 * Set close_older to 1h by defautl * Set ignore_older to infinity by default (means it is disabled by default)
See https://github.com/elastic/filebeat/issues/181