Search code examples
dnshaproxyconsul

Haproxy DNS resolving for log targets


I use an elk stack for logging with haproxy 1.6.3 and I'm also using consul. In haproxy I set the global log to

log logstash.service.consul:514 len 4096 local0 notice

I do know that older haproxy only resolves DNS when it's started. In newer haproxy version I can also use resolvers. And in 1.8 it's also possible to resolve SRV records.

But the documentation doesn't show that resolvers are usable with a log target. So does haproxy only resolve the log target at startup?

Consul itself uses an TTL of 0 for its DNS records.

I do know about consul-templates. But I would like to know how haproxy behaves without it.


Solution

  • Tried it and definitely only resolves at startup of haproxy. Later changes of the DNS record are never resolved by haproxy for log targets.