# Running filebeat as a container to collect container logs

**URL:** <https://discuss.elastic.co/t/running-filebeat-as-a-container-to-collect-container-logs/203316>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [October 12, 2019, 12:20pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-container-to-collect-container-logs/203316 "2019-10-12T12:20:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mai\_Waly](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mai_waly/32/53763_2.png) [@Mai\_Waly](https://discuss.elastic.co/u/Mai_Waly)\
**Post date:** [October 12, 2019, 12:20pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-container-to-collect-container-logs/203316/1 "2019-10-12T12:20:37Z")

</div>

Hi All,

I have installed filebeat as a docker container with the below file:

filebeat.config:  
modules:  
path: ${path.config}/modules.d/\*.yml  
reload.enabled: false

filebeat.autodiscover:  
providers:  
- type: docker  
hints.enabled: true  
filebeat.inputs:

- type: docker  
enabled: true  
containers:  
ids:
  - '\*'  
json.keys\_under\_root: true  
json.add\_error\_key: true  
json.message\_key: log  
processors:
  - add\_docker\_metadata: ~  
setup.kibana:  
host: "kibana:5601"  
output.logstash:  
hosts: ["logstash:5044"]

Its working Ok, question is if I removed line below, its will still be working , why do we need filebeat.input then, can anyone please explain

filebeat.inputs:

- type: docker  
enabled: true  
containers:  
ids:
  - '\*'  
json.keys\_under\_root: true  
json.add\_error\_key: true  
json.message\_key: log

---

<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:** [October 18, 2019, 1:17pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-container-to-collect-container-logs/203316/2 "2019-10-18T13:17:55Z")

</div>

Hi @Mai_Waly.

As far as I know you should not need the static inputs definition if using Autodiscover. Unless, of course, you want some static settings to be applied.

Best regards

---

<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:** [November 15, 2019, 1:17pm UTC](https://discuss.elastic.co/t/running-filebeat-as-a-container-to-collect-container-logs/203316/3 "2019-11-15T13:17:56Z")

</div>

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