Skip to content

Commit

Permalink
support config delimiter in syslog plugin
Browse files Browse the repository at this point in the history
Signed-off-by: Abderrahmane Benbachir <[email protected]>
  • Loading branch information
abenbachir committed Apr 10, 2019
1 parent ca3f9f8 commit 1d7009e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fluent/plugin/in_syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ def initialize
# 13 is the default value of rsyslog and syslog-ng
desc 'The default PRI value (0 - 191 are available)'
config_param :default_priority, :integer, default: 13
desc 'The delimiter value \n'
config_param :delimiter, :string, default: "" # syslog family add "\n" to each message

def configure(conf)
super
Expand Down Expand Up @@ -251,7 +253,7 @@ def listen(callback)
SocketUtil::UdpHandler.new(@usock, log, @message_length_limit, callback, @resolve_hostname)
else
# syslog family add "\n" to each message and this seems only way to split messages in tcp stream
Coolio::TCPServer.new(@bind, @port, SocketUtil::TcpHandler, log, "\n", callback, @resolve_hostname)
Coolio::TCPServer.new(@bind, @port, SocketUtil::TcpHandler, log, @delimiter, callback, @resolve_hostname)
end
end

Expand Down

0 comments on commit 1d7009e

Please sign in to comment.