diff --git a/filebeat/prospector/prospector_log.go b/filebeat/prospector/prospector_log.go index 5496f37e891..8bbb7fb2758 100644 --- a/filebeat/prospector/prospector_log.go +++ b/filebeat/prospector/prospector_log.go @@ -52,7 +52,7 @@ func (p *ProspectorLog) Run() { p.scan() // It is important that a first scan is run before cleanup to make sure all new states are read first - if p.config.CleanInactive > 0 { + if p.config.CleanInactive > 0 || p.config.CleanRemoved { p.Prospector.states.Cleanup() logp.Debug("prospector", "Prospector states cleaned up.") }