# Couldn't Harvest log file from Docker

**URL:** <https://discuss.elastic.co/t/couldnt-harvest-log-file-from-docker/300667>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [March 25, 2022, 7:47am UTC](https://discuss.elastic.co/t/couldnt-harvest-log-file-from-docker/300667 "2022-03-25T07:47:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![chathuwadev\_dev](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chathuwadev_dev/32/103512_2.png) [@chathuwadev\_dev](https://discuss.elastic.co/u/chathuwadev_dev)\
**Post date:** [March 25, 2022, 7:47am UTC](https://discuss.elastic.co/t/couldnt-harvest-log-file-from-docker/300667/1 "2022-03-25T07:47:09Z")

</div>

Hi All,  
I am beginner for ELK stack, Below my work scenario

- I am going to centralize logs from my Microservices

- Also i used ELK stack and i already config it in docker-compose.yml

- Kibana,Elasticsearch and Logstash are completly work without any Errors

- When i was run FileBeat locally without docker it works( i can see logs in Kibana through the logstash and Elasticsearch )

- But when i was going to read logs file from docker mounted file using file beat it doesn't work ("filebeat":{"harvester":{"open\_files":0,"running":0}})

- i have created docker volume with my local logs folder and filebeat container folder("$PWD/log:/usr/share/filebeat/newlogs")

**This is my Docker-compose File**  
\</\>  
filebeat:

```
image: docker-logs-elk/filebeat:8.1.0

build:

  context: filebeat/

  args:

    ELK_VERSION: 8.1.0

volumes:

  - "$PWD/log:/usr/share/filebeat/newlogs"

  - "/var/run/docker.sock:/var/run/docker.sock"

depends_on:

  - elasticsearch

  - logstash

```

\</\>

**below is my filebeat.yml file**  
\</\>  
filebeat.inputs:

- type: docker

filebeat.config:

modules:

```
path: '${path.config}/modules.d/*.yml'

reload.enabled: true

```

filebeat.autodiscover:

providers:

```
- type: docker

  hints.enabled: true

```

output.logstash:

hosts: ["logstash:5044"]  
\</\>

**Below Filebeat's Logs**

\</\>  
{"log.level":"info","@timestamp":"2022-03-25T07:24:08.510Z","log.logger":"monitoring","log.origin":{"file.name":"log/log.go","file.line":184},"message":"Non-zero metrics in the last 30s","service.name":"filebeat","monitoring":{"metrics":{"beat":{"cgroup":{"cpuacct":{"total":{"ns":13430800}},"memory":{"mem":{"usage":{"bytes":4096}}}},"cpu":{"system":{"ticks":1130,"time":{"ms":16}},"total":{"ticks":2540,"time":{"ms":21},"value":2540},"user":{"ticks":1410,"time":{"ms":5}}},"handles":{"limit":{"hard":1048576,"soft":1048576},"open":9},"info":{"ephemeral\_id":"310c58ed-481b-48e1-8b12-fef53a23f6b8","uptime":{"ms":2520280},"version":"8.1.0"},"memstats":{"gc\_next":17308240,"memory\_alloc":9508944,"memory\_total":79589344,"rss":121122816},"runtime":{"goroutines":22}},"filebeat":{"harvester":{"open\_files":0,"running":0}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"active":0}},"pipeline":{"clients":0,"events":{"active":0}}},"registrar":{"states":{"current":0}},"system":{"load":{"1":0.25,"15":0.42,"5":0.28,"norm":{"1":0.0313,"15":0.0525,"5":0.035}}}},"ecs.version":"1.6.0"}}  
\</\>  
**If you have any solution.**  
**Sincerely appreciate your time and consideration.**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 22, 2022, 9:47am UTC](https://discuss.elastic.co/t/couldnt-harvest-log-file-from-docker/300667/2 "2022-04-22T09:47:34Z")

</div>

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