Class DestinationParser

java.lang.Object
net.logstash.logback.appender.destination.DestinationParser

public class DestinationParser extends Object
Constructs InetSocketAddresses by parsing String values.
  • Method Details

    • parse

      public static List<InetSocketAddress> parse(String destinations, int defaultPort)
      Constructs InetSocketAddresses by parsing the given String value.

      The string is a comma separated list of destinations in the form of hostName[:portNumber] where:

      • hostName can be a hostname (eg. localhost), an IPv4 (eg. 192.168.1.1) or an IPv6 enclosed between brackets (eg. [2001:db8::1])
      • portNumber is optional and, if specified, must be prefixed by a colon. Must be a valid integer between 0 and 65535. If portNumber is not provided, then the given defaultPort will be used.

      For example, "host1.domain.com,host2.domain.com:5560"

      Parameters:
      destinations - comma-separated list of destinations in the form of hostName[:portNumber]
      defaultPort - the port number to use when a destination does not specify one explicitly
      Returns:
      ordered list of InetSocketAddress instances