Class: Fluent::CloudwatchInput

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

Instance Method Summary collapse

Constructor Details

#initializeCloudwatchInput

Returns a new instance of CloudwatchInput.



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

def initialize
  super
  require 'aws-sdk'
end

Instance Method Details

#configure(conf) ⇒ Object



25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 25

def configure(conf)
  super

  AWS.config(
    :http_open_timeout => @open_timeout,
    :http_read_timeout => @read_timeout,
  )

  @cw = AWS::CloudWatch.new(
    :access_key_id        => @aws_key_id,
    :secret_access_key    => @aws_sec_key,
    :cloud_watch_endpoint => @cw_endpoint,
  ).client
end

#shutdownObject



45
46
47
48
49
# File 'lib/fluent/plugin/in_cloudwatch.rb', line 45

def shutdown
  super
  @watcher.terminate
  @watcher.join
end

#startObject



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

def start
  super
  @watcher = Thread.new(&method(:watch))
end