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 0eec554 commit 31c8fcd
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/fluent/plugin/in_syslog.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ class SyslogInput < Input

config_param :blocking_timeout, :time, default: 0.5

desc 'The delimiter value \n'
config_param :delimiter, :string, default: "\n" # syslog family add "\n" to each message

config_section :parse do
config_set_default :@type, DEFAULT_PARSER
config_param :with_priority, :bool, default: true
Expand Down Expand Up @@ -156,8 +159,7 @@ def start_udp_server
def start_tcp_server
octet_count_frame = @frame_type == :octet_count

# syslog family adds "\n" to each message when transport is TCP and traditional frame
delimiter = octet_count_frame ? " " : "\n"
delimiter = octet_count_frame ? " " : @delimiter
delimiter_size = delimiter.size
server_create_connection(:in_syslog_tcp_server, @port, bind: @bind, resolve_name: @resolve_hostname) do |conn|
conn.data do |data|
Expand Down

0 comments on commit 31c8fcd

Please sign in to comment.