Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support config delimiter in syslog plugin #2378

Merged
merged 1 commit into from
Apr 11, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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