Class: Fluent::CloudwatchLogsInput
- Inherits:
-
Input
- Object
- Input
- Fluent::CloudwatchLogsInput
- Includes:
- Mixin::ConfigPlaceholders
- Defined in:
- lib/fluent/plugin/in_cloudwatch_logs.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ CloudwatchLogsInput
constructor
A new instance of CloudwatchLogsInput.
- #placeholders ⇒ Object
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ CloudwatchLogsInput
Returns a new instance of CloudwatchLogsInput.
31 32 33 34 35 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 31 def initialize super require 'aws-sdk-cloudwatchlogs' end |
Instance Method Details
#configure(conf) ⇒ Object
41 42 43 44 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 41 def configure(conf) super configure_parser(conf) end |
#placeholders ⇒ Object
37 38 39 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 37 def placeholders [:percent] end |
#shutdown ⇒ Object
67 68 69 70 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 67 def shutdown @finished = true @thread.join end |
#start ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 46 def start = {} [:region] = @region if @region [:http_proxy] = @http_proxy if @http_proxy if @aws_use_sts Aws.config[:region] = [:region] [:credentials] = Aws::AssumeRoleCredentials.new( role_arn: @aws_sts_role_arn, role_session_name: @aws_sts_session_name ) else [:credentials] = Aws::Credentials.new(@aws_key_id, @aws_sec_key) if @aws_key_id && @aws_sec_key end @logs = Aws::CloudWatchLogs::Client.new() @finished = false @thread = Thread.new(&method(:run)) end |