Skip to content

Commit

Permalink
Fix exception when only host_with_port is set (#62)
Browse files Browse the repository at this point in the history
If `@host` is nil, `extract_placeholders` fails.
  • Loading branch information
orgads authored Feb 5, 2025
1 parent 15470e2 commit b19ab11
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/fluent/plugin/out_remote_syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down

0 comments on commit b19ab11

Please sign in to comment.