Class: Fluent::SolrOutput

Inherits:
BufferedOutput
  • Object
show all
Includes:
SolrConfigCommon, SolrUtil
Defined in:
lib/fluent/plugin/out_solr.rb

Overview

Solr output plugin for Fluent

Instance Attribute Summary

Attributes included from SolrConfigCommon

#localtime

Instance Method Summary collapse

Methods included from SolrUtil

#update_core

Constructor Details

#initializeSolrOutput

Returns a new instance of SolrOutput.



15
16
17
18
19
20
21
# File 'lib/fluent/plugin/out_solr.rb', line 15

def initialize
  require 'net/http'
  require 'uri'
  require 'time'
  super
  @localtime = true
end

Instance Method Details

#configure(conf) ⇒ Object



23
24
25
26
27
28
29
30
# File 'lib/fluent/plugin/out_solr.rb', line 23

def configure(conf)
  if conf['utc']
    @localtime = false
  elsif conf['localtime']
    @localtime = true
  end
  super
end

#format(tag, time, record) ⇒ Object



36
37
38
# File 'lib/fluent/plugin/out_solr.rb', line 36

def format(tag, time, record)
  [tag, time, record].to_msgpack
end

#shutdownObject



40
41
42
# File 'lib/fluent/plugin/out_solr.rb', line 40

def shutdown
  super
end

#startObject



32
33
34
# File 'lib/fluent/plugin/out_solr.rb', line 32

def start
  super
end

#write(chunk) ⇒ Object



44
45
46
# File 'lib/fluent/plugin/out_solr.rb', line 44

def write(chunk)
  update_core(chunk, @core)
end