Skip to content

Commit

Permalink
overwrite default value
Browse files Browse the repository at this point in the history
Signed-off-by: Yuta Iwama <ganmacs@gmail.com>
  • Loading branch information
ganmacs committed May 8, 2019
1 parent 50f4ab3 commit bf319e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions lib/fluent/plugin/in_syslog.rb
Expand Up @@ -107,6 +107,11 @@ class SyslogInput < Input
config_param :with_priority, :bool, default: true
end

# overwrite server plugin to change default to :udp
config_section :transport, required: false, multi: false, init: true, param_name: :transport_config do
config_argument :protocol, :enum, list: [:tcp, :udp, :tls], default: :udp
end

def configure(conf)
compat_parameters_convert(conf, :parser)

Expand Down
2 changes: 1 addition & 1 deletion test/plugin/test_in_syslog.rb
Expand Up @@ -55,7 +55,7 @@ def test_configure_resolve_hostname(param)
end
end

data('Use protocol_type' => ['protocol_type tcp', :tcp, :tcp],
data('Use protocol_type' => ['protocol_type tcp', :tcp, :udp],
'Use transport' => ["<transport tcp>\n </transport>", nil, :tcp],
'Use transport and protocol' => ["protocol_type udp\n<transport tcp>\n </transport>", :udp, :tcp])
def test_configure_protocol(param)
Expand Down

0 comments on commit bf319e9

Please sign in to comment.