# Does filebeat cache setting on service start?

**URL:** <https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983>\
**Category:** Beats\
**Created:** [June 1, 2017, 8:37pm UTC](https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983 "2017-06-01T20:37:42Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![boxkiller](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@boxkiller](https://discuss.elastic.co/u/boxkiller)\
**Post date:** [June 1, 2017, 8:37pm UTC](https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983/1 "2017-06-01T20:37:42Z")

</div>

We have filebeat 5.4.0 installed , it seems when we update the DNS record that points to our logstash servers the filebeat agent needs to be restarted before it will use the updated DNS record.

The hosts filebeat is installed on (mix of Ubuntu & RHEL) resolves the correct address when using the DNS name. But filebeat does not, until restart.

Can anyone tell me if filebeat caches the host entry from the filebeat.yml when it starts and if there is a refresh period if it does?

If it does not cache this entry has anyone seen this behavior?

---

<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:** [June 2, 2017, 2:16am UTC](https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983/2 "2017-06-02T02:16:40Z")

</div>

Filebeat will keep the connection to Logstash established so it could be that Filebeat hasn't needed to connect since the DNS entry was changed. I don't know of any name lookup caching in the LS output code. You can debug the name lookups using the GODEBUG environment variable (see [https://golang.org/pkg/net/#hdr-Name\_Resolution](https://golang.org/pkg/net/#hdr-Name_Resolution)). You can configure Go to log anytime it does a name resolution. You should see the Beat doing a lookup whenever it connects to LS.

---

<div class="post-metadata">

**Author:** ![boxkiller](https://avatars.discourse-cdn.com/v4/letter/b/94ad74/32.png) [@boxkiller](https://discuss.elastic.co/u/boxkiller)\
**Post date:** [June 2, 2017, 1:08pm UTC](https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983/3 "2017-06-02T13:08:19Z")

</div>

Thank you for the information. It appears that filebeat was keeping the connection established. Once I stopped Logstash it connected to the new server.

---

<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:** [June 22, 2017, 8:38pm UTC](https://discuss.elastic.co/t/does-filebeat-cache-setting-on-service-start/87983/4 "2017-06-22T20:38:14Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
