# File beats in docker. How to access host logs?

**URL:** https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313
**Category:** Beats
**Tags:** filebeat
**Created:** [April 9, 2018, 11:31am UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313 "2018-04-09T11:31:04Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [April 9, 2018, 11:31am UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/1 "2018-04-09T11:31:04Z")

</div>

Hi,

I am thinking of running filebeat in a docker container. But I wanna ship logs from the host.  
What is the best practice?

Use a volume to make the host logs accessible from inside of the docker container? Or how?

Thanks, Andreas

---

<div class="post-metadata">

### Author: ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)
#### Post date: [April 9, 2018, 4:54pm UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/2 "2018-04-09T16:54:32Z")

</div>

Exactly. Log files of the host are are available under `/var/lib/docker/containers`. You need to mount this in order to access them and use `docker` prospector to read.

---

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [April 9, 2018, 5:30pm UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/3 "2018-04-09T17:30:29Z")

</div>

thanks. I keep that in mind if I need need to ship from other containers.

When I want to ship logs of classic applications from the host, which are not running in docker, then I just mount the host logfile from eg. /var/log/myapplication into the filebeat container and then I use normal file prospector in filebeat, which runs as docker, correct?

---

<div class="post-metadata">

### Author: ![kvch](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kvch/32/72058_2.png) [@kvch](https://discuss.elastic.co/u/kvch)
#### Post date: [April 9, 2018, 5:32pm UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/4 "2018-04-09T17:32:11Z")

</div>

Yes, it's correct.

---

<div class="post-metadata">

### Author: ![asp](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@asp](https://discuss.elastic.co/u/asp)
#### Post date: [April 9, 2018, 5:34pm UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/5 "2018-04-09T17:34:54Z")

</div>

thanks a lot

---

<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: [May 7, 2018, 5:35pm UTC](https://discuss.elastic.co/t/file-beats-in-docker-how-to-access-host-logs/127313/6 "2018-05-07T17:35:02Z")

</div>

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