Filebeat docker input type with different paths

Hi everyone,

I use filebeat for storing docker logs. My docker containers logs path is /home/docker/containers/${data.docker.container.id}/*.log.

But filebeat scans /var/lib/docker/containers/${data.docker.container.id}/*.log defaultly.

How can I give my path for scanning our datas?

In other words how can I change Configured paths to my log folder?

Thanks

My filebeat.yml file as folliwing:

filebeat.inputs:
#------------------------------ Docker input --------------------------------

  • type: docker
    enabled: true
    encoding: "utf-8"
    containers.ids:
    - " * "
    containers.paths:
    - /home/docker/containers/${data.docker.container.id}/*.log
    multiline.pattern: '^[[0-9]{4}-[0-9]{2}-[0-9]{2}'
    multiline.negate: true
    multiline.match: after
    exclude_lines: ["^\s+[\-`('.|_]"] # drop asciiart lines
    processors:
    - add_host_metadata: ~
    - add_docker_metadata: ~

#=========================== Filebeat outputs==============================

output.logstash:
hosts: ["logstash:5044"]

Hi @sahinguler ,

which version of filebeat are you using?

docker input is deprecated in version 7.2.0.
Try using container input instead. You can see how to set the path here.

Hi,
I use 7.13.3 version

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