Sha256: 530f7396b80753f2d190af1247aed776ffb193541f951314fad7106af4962d1a

Contents?: true

Size: 895 Bytes

Versions: 27

Compression:

Stored size: 895 Bytes

Contents

class CloudWatchLogs < Mapper
  #
  # Returns an array of resources.
  #
  def collect
    resources = []

    #
    # describe_log_groups
    #
    @client.describe_log_groups.each_with_index do |response, page|
      log(response.context.operation_name, page)

      response.log_groups.each do |log_group|
        struct = OpenStruct.new(log_group.to_h)
        struct.type = 'log_group'
        struct.metric_filters = []

        # describe_metric_filters
        if log_group.metric_filter_count > 0
          @client.describe_metric_filters.each_with_index do |response, page|
            log(response.context.operation_name, log_group.log_group_name, page)

            response.metric_filters.each do |filter|
              struct.metric_filters.push(filter.to_h)
            end
          end
        end

        resources.push(struct.to_h)
      end
    end

    resources
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
aws_recon-0.2.27 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.26 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.25 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.24 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.23 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.22 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.21 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.20 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.19 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.18 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.17 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.16 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.15 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.14 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.13 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.12 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.11 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.10 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.9 lib/aws_recon/collectors/cloudwatchlogs.rb
aws_recon-0.2.8 lib/aws_recon/collectors/cloudwatchlogs.rb