Skip to content

Commit

Permalink
Merge pull request #2378 from abenbachir/syslog-support-delimiter
Browse files Browse the repository at this point in the history
support config delimiter in syslog plugin
  • Loading branch information
repeatedly authored Apr 11, 2019
2 parents 8015250 + 3e4327a commit 607c43c
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 607c43c

Please sign in to comment.