# Metricbeat collecting mongo-metrics is not updated to elasticsearch

**URL:** <https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 10, 2022, 5:25pm UTC](https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922 "2022-01-10T17:25:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![smileyvignesh](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@smileyvignesh](https://discuss.elastic.co/u/smileyvignesh)\
**Post date:** [January 10, 2022, 5:25pm UTC](https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922/1 "2022-01-10T17:25:38Z")

</div>

Hello everyone, I'm using the metricbeat to get mongodb metics ("dbstats", "status", "collstats", "metrics") and update it to Elasticsearch via logstash. There is no error seen in the logstash logs or metric beat logs. The following metric collection from mongodb is visible in logstash logs,

```auto
2022-01-10T16:59:05.069Z	INFO	[monitoring]	log/log.go:184	Non-zero metrics in the last 30s{"monitoring": {"metrics": {"beat":{"cgroup":{"cpuacct":{"total":{"ns":159270505}},"memory":{"mem":{"usage":{"bytes":614400}}}},"cpu":{"system":{"ticks":170,"time":{"ms":56}},"total":{"ticks":520,"time":{"ms":159},"value":520},"user":{"ticks":350,"time":{"ms":103}}},"handles":{"limit":{"hard":1048576,"soft":1048576},"open":9},"info":{"ephemeral_id":"3daf330b-739c-40c4-898a-3ea59a66d95d","uptime":{"ms":60232},"version":"7.16.2"},"memstats":{"gc_next":21140736,"memory_alloc":14206560,"memory_total":66298160,"rss":161378304},"runtime":{"goroutines":51}},"libbeat":{"config":{"module":{"running":0}},"output":{"events":{"acked":126,"active":0,"batches":9,"total":126},"read":{"bytes":54},"write":{"bytes":24842}},"pipeline":{"clients":4,"events":{"active":0,"published":126,"total":126},"queue":{"acked":126}}},"metricbeat":{"mongodb":{"collstats":{"events":108,"success":108},"dbstats":{"events":12,"success":12},"metrics":{"events":3,"success":3},"status":{"events":3,"success":3}}},"system":{"load":{"1":0.7,"15":0.35,"5":0.51,"norm":{"1":0.0875,"15":0.0438,"5":0.0638}}}}}}

```

However, this is not seen in "discover" tab in kibana. Can some one let me know what could be wrong.

metricbeat.yml

```auto
metricbeat.modules:
- module: mongodb
  metricsets: ["dbstats", "status", "collstats", "metrics"]
  period: 10s
  enabled: true
  hosts: ["shard-1-0.shard-1-service.storage.svc.cluster.local:27017"]
  username: beats
  password: ****
output.logstash:
  hosts: ["<logstash_ip>:5044"]

```

logstash.conf

```auto
input {
      beats {
        port => 5044
      }
    }
    output {
      stdout {
          codec => rubydebug
        }
        elasticsearch {
          hosts => ["${ES_HOSTS}"]
          user => "elastic"
          password => " *******"
          cacert => '/etc/logstash/certificates/ca.crt'
          action => "index"
          index => "mongo_data"
        }
    }

```

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 11, 2022, 12:23am UTC](https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922/2 "2022-01-11T00:23:41Z")

</div>

What's the output from `_cat/indices/mongo_data?v` in Elasticsearch?

---

<div class="post-metadata">

**Author:** ![smileyvignesh](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@smileyvignesh](https://discuss.elastic.co/u/smileyvignesh)\
**Post date:** [January 11, 2022, 1:58pm UTC](https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922/3 "2022-01-11T13:58:25Z")

</div>

Hi warkolm, Thank you for your inputs. The issue is that I have, Ive index mongo\_data already with mongoDb collection and so Ive cleared all the existing data. Now I can able to see the dbstats in kibana listened on port 5044 in logstash. Thanks again for your comment.

---

<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:** [February 8, 2022, 3:59pm UTC](https://discuss.elastic.co/t/metricbeat-collecting-mongo-metrics-is-not-updated-to-elasticsearch/293922/4 "2022-02-08T15:59:05Z")

</div>

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