Class: Fluent::Plugin::CloudwatchLogsInput
- Inherits:
-
Input
- Object
- Input
- Fluent::Plugin::CloudwatchLogsInput
- Defined in:
- lib/fluent/plugin/in_cloudwatch_logs.rb
Instance Method Summary collapse
- #configure(conf) ⇒ Object
-
#initialize ⇒ CloudwatchLogsInput
constructor
A new instance of CloudwatchLogsInput.
- #shutdown ⇒ Object
- #start ⇒ Object
Constructor Details
#initialize ⇒ CloudwatchLogsInput
Returns a new instance of CloudwatchLogsInput.
34 35 36 37 38 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 34 def initialize super require 'aws-sdk-cloudwatchlogs' end |
Instance Method Details
#configure(conf) ⇒ Object
40 41 42 43 44 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 40 def configure(conf) compat_parameters_convert(conf, :parser) super configure_parser(conf) end |
#shutdown ⇒ Object
76 77 78 79 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 76 def shutdown @finished = true super end |
#start ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 |
# File 'lib/fluent/plugin/in_cloudwatch_logs.rb', line 46 def start super = {} [:region] = @region if @region [:endpoint] = @endpoint if @endpoint [: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_create(:in_cloudwatch_logs_runner, &method(:run)) @json_handler = case @json_handler when :yajl Yajl when :json JSON end end |