# MongoDB module error

**URL:** <https://discuss.elastic.co/t/mongodb-module-error/240065>\
**Category:** Beats\
**Tags:** beats-module, filebeat\
**Created:** [July 6, 2020, 10:31pm UTC](https://discuss.elastic.co/t/mongodb-module-error/240065 "2020-07-06T22:31:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![szaharici](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@szaharici](https://discuss.elastic.co/u/szaharici)\
**Post date:** [July 6, 2020, 10:31pm UTC](https://discuss.elastic.co/t/mongodb-module-error/240065/1 "2020-07-06T22:31:06Z")

</div>

Hey guys,

I am trying to use the mongodb filebeat module to parse the logs from mongodb instances running under kubernetes.  
Filebeat is deployed with the elastic-stack helm chart, here is the configuration:

```auto
filebeat:
 enabled: true
 config:
  filebeat.autodiscover:
     providers:
       - type: kubernetes
         templates:
           - condition.equals:
               kubernetes.labels.app: mongo
             config:
               - module: mongodb
                 enabled: true
                 log:
                   input:
                     type: docker
                     containers.ids:
                       - $${data.kubernetes.container.id}
  output.file:
    enabled: false
  output.elasticsearch:
    hosts: [http://elk-elasticsearch-client:9200]
    enabled: true

```

It is working fine on one of the clusters, however on a second one the filebeat containers are erroring out:

> elk-filebeat-fqrwm filebeat 2020-07-06T22:27:58.231Z ERROR [autodiscover] cfgfile/list.go:96 Error creating runner from config: Error unpacking module config: error unpacking module mongodb in a dict: missing field accessing 'log'

Any idea what could cause this ?  
Thanks a lot

---

<div class="post-metadata">

**Author:** ![szaharici](https://avatars.discourse-cdn.com/v4/letter/s/f475e1/32.png) [@szaharici](https://discuss.elastic.co/u/szaharici)\
**Post date:** [July 7, 2020, 3:55pm UTC](https://discuss.elastic.co/t/mongodb-module-error/240065/2 "2020-07-07T15:55:33Z")

</div>

So the issue was related to the additional $ in $${data.kubernetes.container.id}. In one case it was used in a terraform template in the other it was just a config file

---

<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:** [August 4, 2020, 5:55pm UTC](https://discuss.elastic.co/t/mongodb-module-error/240065/3 "2020-08-04T17:55:33Z")

</div>

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