class Fluent::ConfigExpanderInput
Attributes
plugin[RW]
Public Instance Methods
builtin_mapping()
click to toggle source
# File lib/fluent/plugin/in_config_expander.rb, line 14 def builtin_mapping {'__hostname__' => @hostname, '__HOSTNAME__' => @hostname, '${hostname}' => @hostname, '${HOSTNAME}' => @hostname} end
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/in_config_expander.rb, line 25 def configure(conf) super configs = conf.elements.select{|e| e.name == 'config'} if configs.size != 1 raise Fluent::ConfigError, "config_expander needs just one <config> ... </config> section" end ex = expand_config(configs.first) @plugin = Fluent::Plugin.new_input(ex['type']) @plugin.configure(ex) mark_used(configs.first) end
expand_config(conf)
click to toggle source
# File lib/fluent/plugin/in_config_expander.rb, line 18 def expand_config(conf) ex = Fluent::Config::Expander.expand(conf, builtin_mapping()) ex.name = '' ex.arg = '' ex end
mark_used(conf)
click to toggle source
# File lib/fluent/plugin/in_config_expander.rb, line 9 def mark_used(conf) conf.used = conf.keys conf.elements.each{|e| mark_used(e)} end
shutdown()
click to toggle source
# File lib/fluent/plugin/in_config_expander.rb, line 43 def shutdown @plugin.shutdown end
start()
click to toggle source
# File lib/fluent/plugin/in_config_expander.rb, line 39 def start @plugin.start end