Organize initial_params

Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
Kenji Okimoto 2018-07-09 14:30:02 +09:00
parent 799312636c
commit bdacc80488
No known key found for this signature in database
GPG Key ID: F9E3E329A5C5E4A1
2 changed files with 5 additions and 6 deletions

View File

@ -6,17 +6,15 @@ class Fluentd
register_plugin("input", "syslog") register_plugin("input", "syslog")
def self.initial_params def self.initial_params
{ params = {
bind: "0.0.0.0",
port: 5140,
parse_type: "syslog", parse_type: "syslog",
parse: { parse: {
"0" => { "0" => {
"type" => "syslog" "type" => "syslog"
} }
}, }
protocol_type: :udp,
} }
super.compact.deep_merge(params)
end end
def common_options def common_options

View File

@ -10,7 +10,7 @@ class Fluentd
end end
def self.initial_params def self.initial_params
{ params = {
buffer_type: "memory", buffer_type: "memory",
buffer: { buffer: {
"0" => { "0" => {
@ -23,6 +23,7 @@ class Fluentd
} }
} }
} }
super.except(:transport).compact.deep_merge(params)
end end
# TODO overwrite this method to support transport parameter and transport section # TODO overwrite this method to support transport parameter and transport section