Class: Fluent::CloudwatchLogsInput

Inherits:
Input
  • Object
show all
Defined in:
lib/fluent/plugin/in_cloudwatch_logs.rb

Instance Method Summary collapse

Constructor Details

#initializeCloudwatchLogsInput

Returns a new instance of CloudwatchLogsInput.



21
22
23
24
25
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 21

def initialize
  super

  require 'aws-sdk-core'
end

Instance Method Details

#configure(conf) ⇒ Object



27
28
29
30
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 27

def configure(conf)
  super
  configure_parser(conf)
end

#shutdownObject



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

def shutdown
  @finished = true
  @thread.join
end

#startObject



32
33
34
35
36
37
38
39
40
41
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 32

def start
  options = {}
  options[:credentials] = Aws::Credentials.new(@aws_key_id, @aws_sec_key) if @aws_key_id && @aws_sec_key
  options[:region] = @region if @region
  options[:http_proxy] = @http_proxy if @http_proxy
  @logs = Aws::CloudWatchLogs::Client.new(options)

  @finished = false
  @thread = Thread.new(&method(:run))
end