Class: Fluent::LogtailOutput

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

Constant Summary collapse

VERSION =
"0.1.1".freeze
CONTENT_TYPE =
"application/msgpack".freeze
PORT =
443
PATH =
"/".freeze
MAX_ATTEMPTS =
3.freeze
RETRYABLE_CODES =
[429, 500, 502, 503, 504].freeze
USER_AGENT =
"Logtail Fluentd/#{VERSION}".freeze

Instance Method Summary collapse

Instance Method Details

#configure(conf) ⇒ Object



20
21
22
23
24
# File 'lib/fluent/plugin/out_logtail.rb', line 20

def configure(conf)
  @source_token = conf["source_token"]
  @ingesting_host = conf["ingesting_host"]
  super
end

#format(tag, time, record) ⇒ Object



26
27
28
# File 'lib/fluent/plugin/out_logtail.rb', line 26

def format(tag, time, record)
  force_utf8_string_values(record.merge("dt" => Time.at(time).utc.iso8601)).to_msgpack
end

#write(chunk) ⇒ Object



30
31
32
# File 'lib/fluent/plugin/out_logtail.rb', line 30

def write(chunk)
  deliver(chunk, 1)
end