# Dbstats and collstats mongo db metric issues

**URL:** <https://discuss.elastic.co/t/dbstats-and-collstats-mongo-db-metric-issues/144974>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 17, 2018, 11:01pm UTC](https://discuss.elastic.co/t/dbstats-and-collstats-mongo-db-metric-issues/144974 "2018-08-17T23:01:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jonathan\_Thinh](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@Jonathan\_Thinh](https://discuss.elastic.co/u/Jonathan_Thinh)\
**Post date:** [August 17, 2018, 11:01pm UTC](https://discuss.elastic.co/t/dbstats-and-collstats-mongo-db-metric-issues/144974/1 "2018-08-17T23:01:10Z")

</div>

Receiving errors for both collstat and dbstat when running metricbeat in docker container.

dbstats Error:  
2018/08/17 22:31:22.444955 client.go:442: WARN Can not index event (status=400): {"type":"mapper\_parsing\_exception","reason":"object mapping for [mongodb.dbstats.avg\_obj\_size] tried to parse field [avg\_obj\_size] as object, but found a concrete value"}

collstats Error:  
2018/08/17 22:44:04.386625 beat.go:339: CRIT Exiting: 1 error: metricset 'mongodb/collstats' is not registered, metricset not found  
Exiting: 1 error: metricset 'mongodb/collstats' is not registered, metricset not fou

server in use: Ubunutu 16.04  
Mongo version: 3.2.20  
docker image : [docker.elastic.co/beats/metricbeat](http://docker.elastic.co/beats/metricbeat) 5.4.3  
docker run command: docker run -d --volume=/usr/metricbeat/metricbeat.yml:/usr/share/metricbeat/metricbeat.yml --volume=/proc:/hostfs/proc:ro --volume=/sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro --volume=/:/hostfs:ro --net=host [docker.elastic.co/beats/metricbeat:5.4.3](http://docker.elastic.co/beats/metricbeat:5.4.3) metricbeat -e -system.hostfs=/hostfs

mectricbeat.yml:

```auto
- module: mongodb
  hosts: ["127.0.0.1:32018"]
  username: admin
  password: <password>
  metricsets: ["collstats", "dbstats","status"]
  period: 10s
  enabled: true

output.elasticsearch:
  hosts: ["<elasticsearchhosts>"]
  index: "metricbeat-%{+yyyy.MM.dd}"

```

the 'status' metric is working fine and I'm seeing the data in elasticsearch... not sure why the other two metrics are not working.. please help!

---

<div class="post-metadata">

**Author:** ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)\
**Post date:** [August 20, 2018, 12:20pm UTC](https://discuss.elastic.co/t/dbstats-and-collstats-mongo-db-metric-issues/144974/2 "2018-08-20T12:20:59Z")

</div>

It seems there is a conflict in the index mapping mixing an object with a different type.

I see that you removed the Beat version from the index pattern. This can potentially lead to conflicts if you have different Beats running. Can you try to send that to a fresh index and see if you still see the issue? Did you load the template for Metricbeat?

Also I would recommend you to use a more recent version of Metricbeat like 6.3.

---

<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 19, 2018, 6:42pm UTC](https://discuss.elastic.co/t/dbstats-and-collstats-mongo-db-metric-issues/144974/4 "2018-09-19T18:42:26Z")

</div>

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