dockergelf

Is it possible to relay the logs from a docker container to more than one server using gelf?


Currently, I have a docker container sending logs to a Logstash using gelf. Pretty standard configuration set in the docker-compose file used to create the container.

I'm investigating the feasibility of sending the logs of a docker container to more than one instance of ELK. This is not needed for production, but will greatly improve the quality of life of our dev teams.

Reading the docs, it seems that what i need is not possible (at least, they don't mention whether the gelf-address property accepts a list of URIs or not, and I must assume it doesn't while I look for more info).

Does anyone know if this can be achieved? Thanks!


Solution

  • Looking at docker's code here and here I'd say that currently only a single target address is supported.

    // New creates a gelf logger using the configuration passed in on the
    // context. The supported context configuration variable is gelf-address.
    func New(info logger.Info) (logger.Logger, error) {
        // parse gelf address
        address, err := parseAddress(info.Config["gelf-address"])
    

    Potentially, this project andviro/grayproxy looks like it could help you take a single GELF input, and forward it to multiple GELF collectors:

    By default grayproxy configures the input at udp://0.0.0.0:12201 and no outputs. Outputs are added using -out flag and may be specified multiple times