lib/fluent/plugin/parser_xml.rb in fluent-plugin-xml-parser-0.0.4 vs lib/fluent/plugin/parser_xml.rb in fluent-plugin-xml-parser-0.0.5
- old
+ new
@@ -34,10 +34,14 @@
config_param :value_xpaths, :string, :default => '[]'
# This method is called after config_params have read configuration parameters
def configure(conf)
super
- @time_xpath = json_parse(conf['time_xpath'])
+ if conf['time_xpath'].nil?
+ @time_xpath = nil
+ else
+ @time_xpath = json_parse(conf['time_xpath'])
+ end
@time_key = conf['time_key']
@time_format = conf['time_format']
@time_parser = TimeParser.new(@time_format)
@attr_xpaths = json_parse(conf['attr_xpaths'])
@value_xpaths = json_parse(conf['value_xpaths'])