# Metric beat is not pushing data to elastic search - I am using metric beat to monitor host and dockers

**URL:** <https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [October 14, 2019, 1:34pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468 "2019-10-14T13:34:56Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:34pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/1 "2019-10-14T13:34:56Z")

</div>

This is for Host

```auto
metricbeat.modules:                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
#-------------------------- Elasticsearch output ------------------------------                                                                                                                      
output.elasticsearch:                                                                                                                                                                                  
username: "metricbeat_anonymous_user"                                                                                                                                                                
#password: ""                                                                                                                                                                                        
hosts: ["${HOST_ELASTICSEARCH}"]                                                                                                                                                                                                                                                                                                                                                                        
setup.kibana:                                                                                                                                                                                          
host: "${HOST_KIBANA}"                                                                                                                                                                                                                                                                                                                                                                                  
#============================== Dashboards =====================================                                                                                                                     
# These settings control loading the sample dashboards to the Kibana index. Loading                                                                                                                  
# the dashboards is disabled by default and can be enabled either by setting the                                                                                                                     
# options here, or by using the `-setup` CLI flag.                                                                                                                                                   
setup.dashboards.enabled: true                                                                                                                                                                                                                                                                                                                                                                            
logging.level: warning                                                                                                                                                                               
logging.to_files: true                                                                                                                                                                               
logging.to_syslog: false                                                                                                                                                                             
logging.files:                                                                                                                                                                                         
path: /var/log/metricbeat                                                                                                                                                                            
name: metricbeat.log                                                                                                                                                                                 
keepfiles: 2                                                                                                                                                                                         
permissions: 0644

```

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:36pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/2 "2019-10-14T13:36:23Z")

</div>

This is for containers -

metricbeat.modules: - module: system metricsets: ["cpu", "load", "filesystem", "fsstat", "memory", "network", "process", "core", "diskio", "socket"] period: 5s enabled: true processes: ['.\*'] cpu.metrics: ["percentages"] core.metrics: ["percentages"] #------------------------------- Docker Module ------------------------------- - module: docker metricsets: ["container", "cpu", "diskio", "healthcheck", "info", "memory", "network"] hosts: ["unix:///var/run/docker.sock"] enabled: true period: 5s #-------------------------- Elasticsearch output ------------------------------ output.elasticsearch: username: "metricbeat\_anonymous\_user" #password: "" hosts: ["{HOST\_ELASTICSEARCH}"] setup.kibana: host: "{HOST\_KIBANA}" setup.dashboards.enabled: true logging.level: warning logging.to\_files: true logging.to\_syslog: false logging.files: -----

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:37pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/3 "2019-10-14T13:37:57Z")

</div>

My docker-compose file -

version: "2.2" services: # Used as the Metricbeat output # Of course, we could create a cluster with more nodes elasticsearch: image: [docker.elastic.co/elasticsearch/elasticsearch:6.5.4](http://docker.elastic.co/elasticsearch/elasticsearch:6.5.4) container\_name: metricbeat-elasticsearch memswap\_limit: 0 mem\_limit: 2g cap\_add: - IPC\_LOCK environment: - cluster.name=docker-cluster - bootstrap.memory\_lock=true - "ES\_JAVA\_OPTS=-Xms1g -Xmx1g" ulimits: memlock: soft: -1 hard: -1 volumes: - ./config/usr/share/elasticsearch/config/elasticsearch.yml:/usr/share/elasticsearch/config/elasticsearch.yml ports: - "9222:9200" networks: - metricbeat

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:38pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/4 "2019-10-14T13:38:50Z")

</div>

Continuation .... docker-compose

# Used to analyse data sent to elasticsearch from Metricbeat. # Metricbeat directly creates Dashbords into Kibana kibana: image: [docker.elastic.co/kibana/kibana:6.5.4](http://docker.elastic.co/kibana/kibana:6.5.4) container\_name: metricbeat-kibana volumes: - ./config/opt/kibana/config/kibana.yml:/opt/kibana/config/kibana.yml depends\_on: - elasticsearch ports: - "5666:5601" networks: - metricbeat

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:39pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/5 "2019-10-14T13:39:22Z")

</div>

continuation docker compose for metric beat -

metricbeat: build: ./docker/metricbeat container\_name: metricbeat-metricbeat-services command: -e environment: - "WAIT\_FOR\_HOSTS=elasticsearch:9200 kibana:5601" - "HOST\_ELASTICSEARCH=elasticsearch:9200" - "HOST\_KIBANA=kibana:5601" depends\_on: - elasticsearch networks: - metricbeat

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:40pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/6 "2019-10-14T13:40:03Z")

</div>

for metricbeat -host portion

metricbeat-host: build: context: ./docker/metricbeat args: - METRICBEAT\_FILE=metricbeat-host.yml container\_name: metricbeat-metricbeat-host command: -system.hostfs=/hostfs volumes: - /proc:/hostfs/proc:ro - /sys/fs/cgroup:/hostfs/sys/fs/cgroup:ro - /:/hostfs:ro - /var/run/docker.sock:/var/run/docker.sock environment: - "WAIT\_FOR\_HOSTS=elasticsearch:9222 kibana:5666" - "HOST\_ELASTICSEARCH=elasticsearch:9222" - "HOST\_KIBANA=kibana:5666" extra\_hosts: - "elasticsearch:172.17.0.1" # The IP of docker0 interface to access host from container - "kibana:172.17.0.1" # The IP of docker0 interface to access host from container network\_mode: host # Mandatory to monitor HOST filesystem, memory, processes,... networks: metricbeat: external: name: metricbeat

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:42pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/7 "2019-10-14T13:42:27Z")

</div>

![d](https://us1.discourse-cdn.com/elastic/original/3X/5/3/535fb5b387953e69dfab7666c8dc8da9e52f9472.png)

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 14, 2019, 1:43pm UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/8 "2019-10-14T13:43:05Z")

</div>

This Waiting for Cluster... message continuously coming. Using ELK -6.5.4 and Metricbeat 6.5.4

---

<div class="post-metadata">

**Author:** ![ashish\_kumar1490](https://avatars.discourse-cdn.com/v4/letter/a/a4c791/32.png) [@ashish\_kumar1490](https://discuss.elastic.co/u/ashish_kumar1490)\
**Post date:** [October 15, 2019, 3:54am UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/9 "2019-10-15T03:54:12Z")

</div>

Any suggestions.

---

<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 12, 2019, 3:54am UTC](https://discuss.elastic.co/t/metric-beat-is-not-pushing-data-to-elastic-search-i-am-using-metric-beat-to-monitor-host-and-dockers/203468/10 "2019-11-12T03:54:30Z")

</div>

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