# Hosts output target using AD Sites Services

**URL:** <https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670>\
**Category:** Beats\
**Tags:** winlogbeat\
**Created:** [March 20, 2018, 2:20am UTC](https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670 "2018-03-20T02:20:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![PandKing](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@PandKing](https://discuss.elastic.co/u/PandKing)\
**Post date:** [March 20, 2018, 2:20am UTC](https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670/1 "2018-03-20T02:20:04Z")

</div>

What happens when hosts is a domain record that returns multiple addresses ?  
Does it use the first, all of them, only the ones that work, load balance.. ?

The goal was to use sites and services to always return the closest IP first for [logstash.mydomain.com](http://logstash.mydomain.com).

Config OK  
logstash: [logstash.mydomain.com:5044](http://logstash.mydomain.com:5044)...  
connection...  
parse host... OK  
dns lookup... OK  
addresses: 192.168.100.11,168.200.11,192.168.300.11,192.168.400.11  
dial up... OK  
TLS... WARN secure connection disabled  
talk to server... OK  
Status : Stopped  
Name : winlogbeat

---

<div class="post-metadata">

**Author:** ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)\
**Post date:** [March 20, 2018, 2:55pm UTC](https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670/2 "2018-03-20T14:55:15Z")

</div>

It will try each IP until it successfully connects. It does this in a random order. [https://github.com/elastic/beats/blob/768e58ede27f7a80b38c983a83537f8669a0cb04/libbeat/outputs/transport/util.go#L39-L57](https://github.com/elastic/beats/blob/768e58ede27f7a80b38c983a83537f8669a0cb04/libbeat/outputs/transport/util.go#L39-L57)

It won't load balance unless you explicitly configure it to do so with `loadbalance` and `workers`. [https://www.elastic.co/guide/en/beats/winlogbeat/current/logstash-output.html#\_literal\_worker\_literal\_2](https://www.elastic.co/guide/en/beats/winlogbeat/current/logstash-output.html#_literal_worker_literal_2)

---

<div class="post-metadata">

**Author:** ![PandKing](https://avatars.discourse-cdn.com/v4/letter/p/258eb7/32.png) [@PandKing](https://discuss.elastic.co/u/PandKing)\
**Post date:** [March 20, 2018, 2:59pm UTC](https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670/3 "2018-03-20T14:59:07Z")

</div>

Thats disappointing why random?

That takes away our ability to direct winlogbeat to the lostash host closest to the server without additional install logic.

---

<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:** [April 17, 2018, 2:59pm UTC](https://discuss.elastic.co/t/hosts-output-target-using-ad-sites-services/124670/4 "2018-04-17T14:59:24Z")

</div>

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