elastic / beats

:tropical_fish: Beats - Lightweight shippers for Elasticsearch & Logstash
https://www.elastic.co/products/beats
Other
12.11k stars 4.91k forks source link

"has no content yet, skipping" gets logged when File is older than ignore_older #36874

Open marcohald opened 10 months ago

marcohald commented 10 months ago

The Log should not get spammed with "has no content yet, skipping" if the file is older than ignore_older. I added ignore_inactive: since_last_start but that also changed nothing

Please include configurations and logs if available. Config Snippet:

  inputs:
  - fields_under_root: true
    id: application
    ignore_inactive: since_last_start
    ignore_older: 168h
    parsers:
    - multiline:
        match: after
        negate: true
        pattern: ^[0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}:[0-9]{2}
        type: pattern
    paths:
    - /etc/application/*/upload/logs/*.log
    take_over: true
    type: filestream

Log:

Oct 17 13:17:23 app.example.com filebeat[110189]: 
{"log.level":"warn","@timestamp":"2023-10-17T13:17:23.450+0200","log.logger":"file_watcher","log.origin":{"file.name":"filestream/fswatch.go","file.line":204},"message":"file \"/etc/application/prod/upload/logs/check_installation_web_2019-08-21_093048.log\" has no content yet, skipping","service.name":"filebeat","ecs.version":"1.6.0"}
:~# ls -lah /etc/application/prod/upload/logs/check_installation_web_2019-08-21_093048.log
-rw-r--r-- 1 www-data www-data 0 Aug 21  2019 /etc/application/prod/upload/logs/check_installation_web_2019-08-21_093048.log

For confirmed bugs, please report:

botelastic[bot] commented 10 months ago

This issue doesn't have a Team:<team> label.

Bobo357 commented 8 months ago

IMHO that "file xxx has no content yet, skipping" message does not belong to warning level, should be info. Regardless of ignore_older setting. This is very annoying, because filebeat spams VERY OFTEN about Ubuntu system log files like kern.log and dpkg.log that receive messages quite rarely and therefore are empty most of the time after logrotate has rotated them.

Please fix this.

draganHR commented 7 months ago

Trying to drop the message with something like:

processors:
 - drop_event:
     when:
       equals:
         service.name: "filebeat"

...but it doesn't work. Are processors even applied to filebeat logs?

Alphayeeeet commented 5 months ago

Could this log level changed to info or even debug to prevent log spamming?

marcohald commented 1 month ago

The Change of the Logging Level https://github.com/elastic/beats/pull/38421 does not solve this issue . But it is easier to handle now, as it is not logged in any log level we use in production.