Log driver linking to service logstash on different host not working

Hello!

I have a custom Nginx container, where I added the following log_driver

external_links:

  • 'elk-docker/elk-logstash:'
    log_driver: gelf
    log_opt:
    gelf-address: udp://elk-logstash:11111
    gelf-tag: rails-nginx

elk-logstash is in the same environment, but a different stack and on a different host. It works fine if I use the ip address of the ELK host. If I link by service name I receive the following error:

Stopped (500 Server Error: Internal Server Error (“Failed to initialize logging driver: gelf: cannot connect to GELF endpoint: elk- logstash:11111 dial udp: lookup elk- logstash on 8 .8.8.8:53: no such host”))
Host:

Any chance this is solvable in Rancher?

Thanks in advance

I have the same issue but with syslog driver.

Same issue as with syslog driver.

Rancher version: 1.6

There isn’t really a good recent article on how to set up basic logging using log driver and syslog.

I tried to simply run this image of every rancher host, exposing port 514/UDP:

Problem is: when configuring log driver for a service (on the Security/Host tab), there is no way for me to tell it to use “current rancher host IP”, when I point it to an IP address of running syslog container - it works.