# Filebeat docker image

**URL:** https://discuss.elastic.co/t/filebeat-docker-image/107033
**Category:** Beats
**Tags:** filebeat
**Created:** [November 9, 2017, 11:34am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033 "2017-11-09T11:34:16Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Vivek\_Samaga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_samaga/32/43285_2.png) [@Vivek\_Samaga](https://discuss.elastic.co/u/Vivek_Samaga)
#### Post date: [November 9, 2017, 11:34am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/1 "2017-11-09T11:34:16Z")

</div>

Am trying to dockerize filebeat with  
[https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html#\_custom\_image\_configuration](https://www.elastic.co/guide/en/beats/filebeat/current/running-on-docker.html#_custom_image_configuration)  
Using the Dockerfile am building the image and starting the filebeat container with below config

filebeat.prospectors:  
- input\_type: log  
paths:  
- /var/lib/docker/containers/8342306d5cc4d80b9bc0876ed0f70c74108f0d66677324f69483182fac761f93/\*.log  
fields:  
document\_type: docker

and running the image using the command  
`docker run -d containerID`

am able to start the container but its not sending anything to logstash below are the logs of filebeat container

```
    2017/11/09 11:25:***.725613 beat.go:297: INFO Home path: [/usr/share/filebeat] Config path: [/usr/share/filebeat] Data path: [/usr/share/filebeat/data] Logs path: [/usr/share/filebeat/logs]
2017/11/09 11:25:***.725656 beat.go:192: INFO Setup Beat: filebeat; Version: 5.6.3
2017/11/09 11:25:***.725732 logstash.go:90: INFO Max Retries set to: 3
2017/11/09 11:25: ***.725829 outputs.go:*** 8: INFO Activated logstash as output plugin.
2017/11/09 11:25: ***.725930 publish.go:300: INFO Publisher name: 6aaa*** bd46cd
2017/11/09 11:25:***.726148 async.go:63: INFO Flush Interval set to: 1s
2017/11/09 11:25:***.726165 async.go:64: INFO Max Bulk Size set to: 2048
2017/11/09 11:25:***.726188 metrics.go:23: INFO Metrics logging every 30s
2017/11/09 11:25:***.726516 beat.go:233: INFO filebeat start running.
2017/11/09 11:25:***.726581 registrar.go:68: INFO No registry file found under: /usr/share/filebeat/data/registry. Creating a new registry file.
2017/11/09 11:25: ***.734881 registrar.go:*** 6: INFO Loading registrar data from /usr/share/filebeat/data/registry
2017/11/09 11:25:***.734974 registrar.go:123: INFO States Loaded from registrar: 0
2017/11/09 11:25:***.735046 crawler.go:38: INFO Loading Prospectors: 1
2017/11/09 11:25:***.735085 registrar.go:236: INFO Starting Registrar
2017/11/09 11:25:***.735112 sync.go:41: INFO Start sending events to output
2017/11/09 11:25:***.735206 prospector_log.go:65: INFO Prospector with previous states loaded: 0
2017/11/09 11:25:***.735294 spooler.go:63: INFO Starting spooler: spool_size: 2048; idle_timeout: 5s
2017/11/09 11:25:***.735305 config.go:95: WARN DEPRECATED: document_type is deprecated. Use fields instead.
2017/11/09 11:25:***.735333 prospector.go:124: INFO Starting prospector of type: log; id: 13016399965924021494
2017/11/09 11:25:***.735360 crawler.go:58: INFO Loading and starting Prospectors completed. Enabled prospectors: 1
2017/11/09 11:25:40.726541 metrics.go:39: INFO Non-zero metrics in the last 30s: registrar.writes=1
2017/11/09 11:26:***.726500 metrics.go:34: INFO No non-zero metrics in the last 30s

```

Can somebody help me in debugging this.

---

<div class="post-metadata">

### Author: ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)
#### Post date: [November 9, 2017, 1:34pm UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/2 "2017-11-09T13:34:04Z")

</div>

You need to mount `/var/lib/docker/containers/` into filebeat container. Try adding this flag to your `docker run` command:

`-v /var/lib/docker/containers/:/var/lib/docker/containers/`

---

<div class="post-metadata">

### Author: ![Vivek\_Samaga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_samaga/32/43285_2.png) [@Vivek\_Samaga](https://discuss.elastic.co/u/Vivek_Samaga)
#### Post date: [November 13, 2017, 10:10am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/3 "2017-11-13T10:10:37Z")

</div>

Yes i tried  
`docker run -v /var/lib/docker/containers/:/var/lib/docker/containers/ (Filebeat_ImageID)`

Still no change am not able to consume the logs.

---

<div class="post-metadata">

### Author: ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)
#### Post date: [November 13, 2017, 10:22am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/4 "2017-11-13T10:22:51Z")

</div>

It may be a permissions issue, you may need to update permissions or run filebeat as root:

`docker run -u root -v /var/lib/docker/containers/:/var/lib/docker/containers/ {image} filebeat -e -v --strict.perms=false`

---

<div class="post-metadata">

### Author: ![Vivek\_Samaga](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vivek_samaga/32/43285_2.png) [@Vivek\_Samaga](https://discuss.elastic.co/u/Vivek_Samaga)
#### Post date: [November 13, 2017, 10:56am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/5 "2017-11-13T10:56:02Z")

</div>

Thanks 🙂

---

<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: [December 11, 2017, 10:56am UTC](https://discuss.elastic.co/t/filebeat-docker-image/107033/6 "2017-12-11T10:56:02Z")

</div>

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