Running filebeat as a container to collect container logs

Hi All,

I have installed filebeat as a docker container with the below file:

filebeat.config:
modules:
path: ${path.config}/modules.d/*.yml
reload.enabled: false

filebeat.autodiscover:
providers:
- type: docker
hints.enabled: true
filebeat.inputs:

  • type: docker
    enabled: true
    containers:
    ids:
    • '*'
      json.keys_under_root: true
      json.add_error_key: true
      json.message_key: log
      processors:
    • add_docker_metadata: ~
      setup.kibana:
      host: "kibana:5601"
      output.logstash:
      hosts: ["logstash:5044"]

Its working Ok, question is if I removed line below, its will still be working , why do we need filebeat.input then, can anyone please explain

filebeat.inputs:

  • type: docker
    enabled: true
    containers:
    ids:
    • '*'
      json.keys_under_root: true
      json.add_error_key: true
      json.message_key: log

Hi @Mai_Waly.

As far as I know you should not need the static inputs definition if using Autodiscover. Unless, of course, you want some static settings to be applied.

Best regards

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