Class: Fluent::LogitOutput

Inherits:
BufferedOutput
  • Object
show all
Defined in:
lib/fluent/plugin/out_logit.rb

Instance Method Summary collapse

Constructor Details

#initializeLogitOutput

Returns a new instance of LogitOutput.



6
7
8
9
10
11
# File 'lib/fluent/plugin/out_logit.rb', line 6

def initialize
  super
  require 'socket'
  require 'timeout'
  require 'fileutils'
end

Instance Method Details

#configure(conf) ⇒ Object



21
22
23
24
25
26
27
28
29
# File 'lib/fluent/plugin/out_logit.rb', line 21

def configure(conf)
  super
  if /[\w]{8}(-[\w]{4}){3}-[\w]{12}/.match(@stack_id) == nil
    raise "stack_id is required and must be a GUID. See the source wizard"
  end
  if @port == 0
    raise "port is required. See the source wizard."
  end
end

#format(tag, time, record) ⇒ Object



39
40
41
# File 'lib/fluent/plugin/out_logit.rb', line 39

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

#shutdownObject



35
36
37
# File 'lib/fluent/plugin/out_logit.rb', line 35

def shutdown
  super
end

#startObject



31
32
33
# File 'lib/fluent/plugin/out_logit.rb', line 31

def start
  super
end

#write(chunk) ⇒ Object



43
44
45
46
47
# File 'lib/fluent/plugin/out_logit.rb', line 43

def write(chunk)
  return if chunk.empty?

  send_data(chunk)
end