diff --git a/lib/fluent/plugin/out_remote_syslog.rb b/lib/fluent/plugin/out_remote_syslog.rb index 3e163b7..44b9a32 100644 --- a/lib/fluent/plugin/out_remote_syslog.rb +++ b/lib/fluent/plugin/out_remote_syslog.rb @@ -79,11 +79,11 @@ def format(tag, time, record) def write(chunk) return if chunk.empty? - host = extract_placeholders(@host, chunk.metadata) - port = @port - if @host_with_port host, port = extract_placeholders(@host_with_port, chunk.metadata).split(":") + else + host = extract_placeholders(@host, chunk.metadata) + port = @port end host_with_port = "#{host}:#{port}"