class Fluent::SolrTimeSlicedOutput
Solr output plugin for Fluent
Public Class Methods
new()
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 18 def initialize require 'net/http' require 'uri' require 'time' super @localtime = true end
Public Instance Methods
configure(conf)
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 26 def configure(conf) if conf['core'] if conf['core'].index('%S') conf['time_slice_format'] = '%Y%m%d%H%M%S' elsif conf['core'].index('%M') conf['time_slice_format'] = '%Y%m%d%H%M' elsif conf['core'].index('%H') conf['time_slice_format'] = '%Y%m%d%H' end end super end
core_format(chunk_key)
click to toggle source
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 51 def core_format(chunk_key) Time.strptime(chunk_key, @time_slice_format).strftime(@core) end
format(tag, time, record)
click to toggle source
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 43 def format(tag, time, record) [tag, time, record].to_msgpack end
shutdown()
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 47 def shutdown super end
start()
click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 39 def start super end
write(chunk)
click to toggle source
# File lib/fluent/plugin/out_solr_time_sliced.rb, line 55 def write(chunk) update_core(chunk, core_format(chunk.key)) end