# Data.host is empty when running on ecs

**URL:** <https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [June 21, 2018, 6:45pm UTC](https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931 "2018-06-21T18:45:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![anhlon](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@anhlon](https://discuss.elastic.co/u/anhlon)\
**Post date:** [June 21, 2018, 6:45pm UTC](https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931/1 "2018-06-21T18:45:32Z")

</div>

Hi All,

I have setup up metricbeat with docker provider and autodiscover. It works really well when running it locally via docker-compose or swarm for local testing. I proceeded to deploy metricbeat to ecs and have it run on all backing EC2 instances and it is collecting metric data for "metricset.module=docker". I then proceeded to setup a rabbitmq and a logstash module to have it collect the proper metrics for those services. However, what I am seeing is

```
2018-06-21T18:34:01.116Z	DEBUG	[autodiscover]	autodiscover/autodiscover.go:140	Failed to create runner with config &{{<nil> } <nil> 0xc420435180}: 1 error: 2 errors: host parsing failed for logstash-node: error parsing URL: empty host; host parsing failed for logstash-node_stats: error parsing URL: empty host

```

it seems that `${data.host}` is returning an empty value. Some additional info;  
Metricbeat version 6.3.0  
ECS containers are using host networking and I have verified that from the metricbeat container I can curl to the logstash and rabbitmq containers.

Any suggestions?

Thanks

---

<div class="post-metadata">

**Author:** ![exekias](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/exekias/32/28718_2.png) [@exekias](https://discuss.elastic.co/u/exekias)\
**Post date:** [June 22, 2018, 9:57am UTC](https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931/2 "2018-06-22T09:57:52Z")

</div>

Hi @anhlon,

Autodiscover doesn't support host network as of 6.3.0, yesterday we merged a pull request that will bring it to 6.4.0:

> <https://github.com/elastic/beats/pull/6708>

In the meantime, you can probably use a default in case host is not defined. I think `${data.host:localhost}` should work.

Best regards

---

<div class="post-metadata">

**Author:** ![anhlon](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@anhlon](https://discuss.elastic.co/u/anhlon)\
**Post date:** [June 22, 2018, 4:10pm UTC](https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931/3 "2018-06-22T16:10:36Z")

</div>

thanks, that worked!

---

<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:** [July 20, 2018, 4:10pm UTC](https://discuss.elastic.co/t/data-host-is-empty-when-running-on-ecs/136931/4 "2018-07-20T16:10:43Z")

</div>

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