Skip to content

Commit b19ab11

Browse files
authored
Fix exception when only host_with_port is set (#62)
If `@host` is nil, `extract_placeholders` fails.
1 parent 15470e2 commit b19ab11

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/fluent/plugin/out_remote_syslog.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ def format(tag, time, record)
7979
def write(chunk)
8080
return if chunk.empty?
8181

82-
host = extract_placeholders(@host, chunk.metadata)
83-
port = @port
84-
8582
if @host_with_port
8683
host, port = extract_placeholders(@host_with_port, chunk.metadata).split(":")
84+
else
85+
host = extract_placeholders(@host, chunk.metadata)
86+
port = @port
8787
end
8888

8989
host_with_port = "#{host}:#{port}"

0 commit comments

Comments
 (0)