Class: Fluent::NorikraOutput

Inherits:
BufferedOutput
  • Object
show all
Includes:
Fluent::NorikraPlugin::OutputMixin
Defined in:
lib/fluent/plugin/out_norikra.rb

Instance Method Summary collapse

Methods included from Fluent::NorikraPlugin::OutputMixin

#fetch_event_registration, #format_stream, #prepare_target, #prepared?, #register_worker, #setup_output, #shutdown_output, #start_output, #stop_output, #write

Instance Method Details

#client(opts = {}) ⇒ Object



50
51
52
53
54
55
56
# File 'lib/fluent/plugin/out_norikra.rb', line 50

def client(opts={})
  Norikra::Client.new(@host, @port, {
      :connect_timeout => opts[:connect_timeout] || @connect_timeout,
      :send_timeout    => opts[:send_timeout]    || @send_timeout,
      :receive_timeout => opts[:receive_timeout] || @receive_timeout,
    })
end

#configure(conf) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
# File 'lib/fluent/plugin/out_norikra.rb', line 37

def configure(conf)
  super

  @host,@port = @norikra.split(':', 2)
  @port = @port.to_i

  if !@target_map_tag && @target_map_key.nil? && @target_string.nil?
    raise Fluent::ConfigError, 'target naming not specified (target_map_tag/target_map_key/target_string)'
  end

  setup_output(conf, false) # <query> disabled in <default> and <target TARGET>
end

#fetchable?Boolean

Returns:

  • (Boolean)


68
69
70
# File 'lib/fluent/plugin/out_norikra.rb', line 68

def fetchable?
  true
end

#shutdownObject



63
64
65
66
# File 'lib/fluent/plugin/out_norikra.rb', line 63

def shutdown
  stop_output
  shutdown_output
end

#startObject



58
59
60
61
# File 'lib/fluent/plugin/out_norikra.rb', line 58

def start
  super
  start_output
end