class Fluent::TextParser::JSONTransformParser
Constants
- DEFAULTS
Public Instance Methods
call(text)
click to toggle source
# File lib/fluent/plugin/parser_json_transform.rb, line 24 def call(text) raw_json = JSON.parse(text) return nil, @transformer.transform(raw_json) end
configure(conf)
click to toggle source
# File lib/fluent/plugin/parser_json_transform.rb, line 10 def configure(conf) @transform_script = conf['transform_script'] if DEFAULTS.include?(@transform_script) @transform_script = "#{__dir__}/../../transform/#{@transform_script}.rb" elsif @transform_script == 'custom' @transform_script = conf['script_path'] end require @transform_script @transformer = JSONTransformer.new end
parse(text)
click to toggle source
# File lib/fluent/plugin/parser_json_transform.rb, line 29 def parse(text) raw_json = JSON.parse(text) return nil, @transformer.transform(raw_json) end