# Read containers log files using fleet

**URL:** <https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067>\
**Category:** Elasticsearch\
**Tags:** docker, fleet\
**Created:** [October 30, 2021, 5:58pm UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067 "2021-10-30T17:58:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vovan13111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vovan13111/32/96560_2.png) [@vovan13111](https://discuss.elastic.co/u/vovan13111)\
**Post date:** [October 30, 2021, 5:58pm UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067/1 "2021-10-30T17:58:29Z")

</div>

Good afternoon.  
When studying Fleet and apm agents, the question arose, is it possible to somehow collect logs from docker containers, as done in [filebeat](https://www.elastic.co/guide/en/beats/filebeat/current/filebeat-input-container.html), or is there no such possibility yet?

---

<div class="post-metadata">

**Author:** ![E001946](https://avatars.discourse-cdn.com/v4/letter/e/ccd318/32.png) [@E001946](https://discuss.elastic.co/u/E001946)\
**Post date:** [November 12, 2021, 5:21pm UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067/2 "2021-11-12T17:21:50Z")

</div>

Hello,

I am also interesting to know if Elastic Agent and Fleet server can be configured to collect docker logs.  
I tried with "Generic Log" integration module but the result is not correct: The log files are collected but we don't have container information (name, ...)

Thanks.  
Richard.

---

<div class="post-metadata">

**Author:** ![Michalis\_Katsoulis](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/michalis_katsoulis/32/93500_2.png) [@Michalis\_Katsoulis](https://discuss.elastic.co/u/Michalis_Katsoulis)\
**Post date:** [November 16, 2021, 2:03pm UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067/3 "2021-11-16T14:03:52Z")

</div>

Hello,

Yes it is possible to collect docker container logs by using the Custom Logs integration and setting /var/lib/docker/containers/_/_-json.log as Log file path.

Also if you are using docker as runtime for Kubernetes you can collect the container logs using Kubernetes Container Logs integration.

---

<div class="post-metadata">

**Author:** ![vovan13111](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vovan13111/32/96560_2.png) [@vovan13111](https://discuss.elastic.co/u/vovan13111)\
**Post date:** [December 10, 2021, 4:50am UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067/4 "2021-12-10T04:50:46Z")

</div>

Hello,  
Is it possible to parse the JSON structure in message, because I can include this option in the filebeat?

---

<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:** [January 7, 2022, 4:51am UTC](https://discuss.elastic.co/t/read-containers-log-files-using-fleet/288067/5 "2022-01-07T04:51:39Z")

</div>

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