Was trying to install metricbeat on docker to analyse docker containers. But I am getting this error.
2018/04/10 09:51:13.057126 beat.go:297: INFO Home path: [/usr/share/metricbeat] Config path: [/usr/share/metricbeat] Data path: [/usr/share/metricbeat/data] Logs path: [/usr/share/metricbeat/logs]
2018/04/10 09:51:13.057248 beat.go:192: INFO Setup Beat: metricbeat; Version: 5.6.8
2018/04/10 09:51:13.058260 metrics.go:23: INFO Metrics logging every 30s
2018/04/10 09:51:16.059090 add_cloud_metadata.go:231: INFO add_cloud_metadata: hosting provider type not detected.
2018/04/10 09:51:16.059742 output.go:258: INFO Loading template enabled. Reading template file: /usr/share/metricbeat/metricbeat.template.json
2018/04/10 09:51:16.064707 output.go:269: INFO Loading template enabled for Elasticsearch 2.x. Reading template file: /usr/share/metricbeat/metricbeat.template-es2x.json
2018/04/10 09:51:16.069881 output.go:281: INFO Loading template enabled for Elasticsearch 6.x. Reading template file: /usr/share/metricbeat/metricbeat.template-es6x.json
2018/04/10 09:51:16.079627 client.go:128: INFO Elasticsearch url: http://elasticsearch:9200
2018/04/10 09:51:16.079774 outputs.go:108: INFO Activated elasticsearch as output plugin.
2018/04/10 09:51:16.079999 publish.go:300: INFO Publisher name: a4971fa7dfd3
2018/04/10 09:51:16.080335 async.go:63: INFO Flush Interval set to: 1s
2018/04/10 09:51:16.080362 async.go:64: INFO Max Bulk Size set to: 50
2018/04/10 09:51:16.080582 metricbeat.go:28: INFO Register [ModuleFactory:[docker, mongodb, mysql, postgresql, system], MetricSetFactory:[apache/status, ceph/cluster_disk, ceph/cluster_health, ceph/monitor_health, ceph/pool_disk, couchbase/bucket, couchbase/cluster, couchbase/node, docker/container, docker/cpu, docker/diskio, docker/healthcheck, docker/image, docker/info, docker/memory, docker/network, haproxy/info, haproxy/stat, jolokia/jmx, kafka/consumergroup, kafka/partition, mongodb/dbstats, mongodb/status, mysql/status, nginx/stubstatus, php_fpm/pool, postgresql/activity, postgresql/bgwriter, postgresql/database, prometheus/collector, prometheus/stats, redis/info, redis/keyspace, system/core, system/cpu, system/diskio, system/filesystem, system/fsstat, system/load, system/memory, system/network, system/process, system/socket, zookeeper/mntr]]
2018/04/10 09:51:16.082212 socket.go:64: INFO socket process info will only be available for metricbeat because the process is running as a non-root user
2018/04/10 09:51:16.085344 beat.go:233: INFO metricbeat start running.
2018/04/10 09:51:17.089955 tcp.go:26: WARN DNS lookup failure "elasticsearch": lookup elasticsearch: no such host
2018/04/10 09:51:17.090029 single.go:140: ERR Connecting error publishing events (retrying): Get http://elasticsearch:9200: lookup elasticsearch: no such host
2018/04/10 09:51:18.105353 tcp.go:26: WARN DNS lookup failure "elasticsearch": lookup elasticsearch: no such host
2018/04/10 09:51:18.105423 single.go:140: ERR Connecting error publishing events (retrying): Get http://elasticsearch:9200: lookup elasticsearch: no such host
2018/04/10 09:51:20.112554 tcp.go:26: WARN DNS lookup failure "elasticsearch": lookup elasticsearch: no such host
2018/04/10 09:51:20.112626 single.go:140: ERR Connecting error publishing events (retrying): Get http://elasticsearch:9200: lookup elasticsearch: no such host
2018/04/10 09:51:24.127810 tcp.go:26: WARN DNS lookup failure "elasticsearch": lookup elasticsearch: no such host
2018/04/10 09:51:24.127921 single.go:140: ERR Connecting error publishing events (retrying): Get http://elasticsearch:9200: lookup elasticsearch: no such host
2018/04/10 09:51:32.137355 tcp.go:26: WARN DNS lookup failure "elasticsearch": lookup elasticsearch: no such host
2018/04/10 09:51:32.137449 single.go:140: ERR Connecting error publishing events (retrying): Get http://elasticsearch:9200: lookup elasticsearch: no such host
^C2018/04/10 09:51:35.325006 metrics.go:51: INFO Total non-zero values: fetches.system-cpu.events=2 fetches.system-cpu.success=2 fetches.system-filesystem.events=3 fetches.system-filesystem.success=1 fetches.system-fsstat.events=1 fetches.system-fsstat.success=1 fetches.system-load.events=2 fetches.system-load.success=2 fetches.system-memory.events=2 fetches.system-memory.success=2 fetches.system-network.events=4 fetches.system-network.success=2 fetches.system-process.events=2 fetches.system-process.success=2 fetches.system-socket.success=39 libbeat.outputs.messages_dropped=1 libbeat.publisher.messages_in_worker_queues=16 libbeat.publisher.published_events=16
2018/04/10 09:51:35.325051 metrics.go:52: INFO Uptime: 22.276472054s
2018/04/10 09:51:35.325062 beat.go:237: INFO metricbeat stopped.
Please let me know what can be done to eliminate this error.