Class: Fluent::CloudwatchLogsInput

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

Instance Method Summary collapse

Constructor Details

#initializeCloudwatchLogsInput

Returns a new instance of CloudwatchLogsInput.



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

def initialize
  super

  require 'aws-sdk-core'
end

Instance Method Details

#configure(conf) ⇒ Object



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

def configure(conf)
  super
  configure_parser(conf)
end

#placeholdersObject



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

def placeholders
  [:percent]
end

#shutdownObject



51
52
53
54
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 51

def shutdown
  @finished = true
  @thread.join
end

#startObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 40

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