# Nginx logs when filebeat and nginx both are running in containers

**URL:** <https://discuss.elastic.co/t/nginx-logs-when-filebeat-and-nginx-both-are-running-in-containers/232810>\
**Category:** Beats\
**Tags:** docker, filebeat\
**Created:** [May 15, 2020, 11:54am UTC](https://discuss.elastic.co/t/nginx-logs-when-filebeat-and-nginx-both-are-running-in-containers/232810 "2020-05-15T11:54:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Arun\_Mittal](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/arun_mittal/32/68434_2.png) [@Arun\_Mittal](https://discuss.elastic.co/u/Arun_Mittal)\
**Post date:** [May 15, 2020, 11:54am UTC](https://discuss.elastic.co/t/nginx-logs-when-filebeat-and-nginx-both-are-running-in-containers/232810/1 "2020-05-15T11:54:35Z")

</div>

I am running filebeat and nginx in different containers.

nginx is writing logs in a custom path within the container:  
`/config/log/nginx/access.log`

My compose and filebeat configs:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6acadd0e40308cb54adcf5f4cfdb0005aa675c95.png)  
 ![image](https://us1.discourse-cdn.com/elastic/original/3X/2/f/2f0ecf961d02262933b2b70ccf5b1dcd66ef179c.png)

filebeat is not able to read logs. Even i am not able to think how it works.

How attaching `/var/lib/docker/containers:/var/lib/docker/containers:ro` makes sure that file is read?

Need help in understanding how container input works and how it gets inside another containers filesystem

---

<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:** [June 12, 2020, 11:54am UTC](https://discuss.elastic.co/t/nginx-logs-when-filebeat-and-nginx-both-are-running-in-containers/232810/2 "2020-06-12T11:54:50Z")

</div>

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