# Filebeat doesn't accept logs with container name

**URL:** https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723
**Category:** Beats
**Tags:** docker, filebeat
**Created:** [August 4, 2020, 2:20pm UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723 "2020-08-04T14:20:41Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![mohanr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohanr/32/73317_2.png) [@mohanr](https://discuss.elastic.co/u/mohanr)
#### Post date: [August 4, 2020, 2:20pm UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723/1 "2020-08-04T14:20:41Z")

</div>

Hi,

We are using Docker to deploy microservice. Every time when we run a new container. Its id will be changed. Default logs path looks like `/var/lib/docker/containers/<container-id>/<container-id>-json.log`. We are using the ELK stack for logs pipeline. filebeat read the logs through container-id or path.  
Is there any way to use container-name rather than container-id or anything else to make it dynamic?

---

<div class="post-metadata">

### Author: ![Ankur\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankur_mahajan/32/45618_2.png) [@Ankur\_Mahajan](https://discuss.elastic.co/u/Ankur_Mahajan)
#### Post date: [August 5, 2020, 5:20am UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723/2 "2020-08-05T05:20:50Z")

</div>

This is a good feature to have to make the docker deployment easy otherwise the inputs need to change after one container is down. Which is really a pain.

---

<div class="post-metadata">

### Author: ![Ankur\_Mahajan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ankur_mahajan/32/45618_2.png) [@Ankur\_Mahajan](https://discuss.elastic.co/u/Ankur_Mahajan)
#### Post date: [August 5, 2020, 5:37pm UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723/3 "2020-08-05T17:37:10Z")

</div>

You can use processor for this.

```
processors:
  - add_docker_metadata: ~
```

---

<div class="post-metadata">

### Author: ![mohanr](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mohanr/32/73317_2.png) [@mohanr](https://discuss.elastic.co/u/mohanr)
#### Post date: [August 5, 2020, 5:44pm UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723/4 "2020-08-05T17:44:07Z")

</div>

Thanks, Its working for me.

---

<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: [September 2, 2020, 7:44pm UTC](https://discuss.elastic.co/t/filebeat-doesnt-accept-logs-with-container-name/243723/5 "2020-09-02T19:44:09Z")

</div>

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