Class: Fluent::ScriptFilter
- Inherits:
-
Filter
- Object
- Filter
- Fluent::ScriptFilter
- Defined in:
- lib/fluent/plugin/filter_script.rb
Instance Method Summary collapse
Instance Method Details
#configure(conf) ⇒ Object
11 12 13 14 |
# File 'lib/fluent/plugin/filter_script.rb', line 11 def configure(conf) super load_script_file(conf['path'].to_s) end |
#filter(tag, time, record) ⇒ Object
7 8 9 |
# File 'lib/fluent/plugin/filter_script.rb', line 7 def filter(tag, time, record) record end |
#load_script_file(path) ⇒ Object
16 17 18 19 |
# File 'lib/fluent/plugin/filter_script.rb', line 16 def load_script_file(path) raise ConfigError, "Ruby script file does not exist: #{path}" unless File.exist?(path) eval "self.instance_eval do;" + IO.read(path) + ";end" end |