Filebeat - 10000s of messages "Reader was closed. Closing.#011" flooding log

Hey there
Subject says it all. I have a simple filebeat agent pointing to some other team's LS that I don't control. I get spammed with the following line at a rate of up to 1000/minute and it doesn't stop. Here an example of 10 within 1 second.

2023-03-31T23:57:49.607784+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.607Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.628766+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.628Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.628785+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.628Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.630121+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.630Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.631337+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.631Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.632751+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.632Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.634455+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.634Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.639994+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.639Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.641195+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.641Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
2023-03-31T23:57:49.642599+00:00 syslog-c01n01 filebeat[25349]: 2023-03-31T23:57:49.642Z INFO [input.filestream] map[file.line:321 file.name:filestream/input.go] Reader was closed. Closing.#011{"ecs.version": "1.6.0"}
  1. What does this mean ?
  2. Why is it always "#011"
  3. What does #011 refer to ?

thx

The beats are pretty noisy and will spam your system logs since per default they log to stdout.

My suggestion is to edit your filebeat.yml to log to a file and change the log level to warning with the following config.

logging.level: warning
logging.to_files: true
logging.files:
  path: /var/log/filebeat
  name: filebeat
  keepfiles: 7
  permissions: 0640

If I'm not wrong I tink that your log basically means that it finished reading a file.

The #011 part is just the ASCII code for the tab character in octal.

Only one problem. This also disables the monitoring json output that u get every 30s under log level info. I'm using that to graph all the beats stats :frowning:
This #011 bit looks like it should be only part of debug logging in my opinion.

Interesting here is the line of code.

Looks like this should be classified as an ERROR...

@andrewkroh ^ Looks like ERROR Message as INFO also is this an actual error or just normal closing of files.

That looks like a message relating to the normal operation of the input. The input will close the reader for several reason such as the file has been inactive for a period of time (it will reopen after it sees changes). I think it would be better to have that a the debug level (and perhaps have some metrics related to the reader instances that can show what's happening over time).

Can you open a github issue for log spam problem coming from this line.

Filebeat has an HTTP API that can return metrics if you don't want to (or can't) scrape them from logs. See Configure an HTTP endpoint for metrics | Filebeat Reference [8.11] | Elastic.

Done

thx

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.