fluent-plugin-cloudwatch-ingest 1.2.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9099fc9a7106d463763eedd19d543e9e1023231c
4
- data.tar.gz: 2d0203a3edd8f96f7a0f25a71dadf79b1d6f8c3d
3
+ metadata.gz: e71179fd143c24d2f1e0c41e5368b93f69ab9ee2
4
+ data.tar.gz: 7f5f859479b39059a3fb5086fdfa1cb79193d828
5
5
  SHA512:
6
- metadata.gz: 41d7a5122379a9e2c8ff975e61b49475e2a1ee31b7ca3bba5aa468e5913f7d1ed2f71e7175f7fb2a2fef3c5a1f844150fc9a35054e0d235152b1fe39ba18132e
7
- data.tar.gz: 39c4c78a663a47054c147e785075de17eb70f12933eb42a1f4e821485cb7e59bed17d260babe967b22edb84687213dafdbd6f7fa0a478e61eccb13eff265cc9a
6
+ metadata.gz: 8f036ac6cc92eaa5762986352b03a339a498fe8de4690e1b48572d7a0232ef2975f75eb34b6a605b7e9fed510dae0225d7454ca228c4e0e20e8faec2d2538a36
7
+ data.tar.gz: 74823d37c5ee4a19d71d40bcfe496a3a399e01b700bc9129c5c83512e3529f3a643da6ff4e037d08c310641aba0c71d30d299af0892889903ed2c77353be807c
data/README.md CHANGED
@@ -37,6 +37,7 @@ Or install it yourself as:
37
37
  aws_logging_enabled true
38
38
  log_group_name_prefix /aws/lambda
39
39
  log_stream_name_prefix 2017
40
+ log_group_exclude_regexp [^A-Z]{1}.* # exclude log groups that start with a captial
40
41
  state_file_name /mnt/nfs/cloudwatch.state
41
42
  interval 60
42
43
  error_interval 5 # Time to wait between error conditions before retry
@@ -52,8 +53,8 @@ Or install it yourself as:
52
53
  event_time true # take time from the Cloudwatch event, rather than parse it from the body
53
54
  inject_group_name true # inject the group name into the record
54
55
  inject_stream_name true # inject the stream name into the record
55
- inject_cloudwatch_ingestion_time field_name # inject the `ingestion_time` as returned by the Cloudwatch API
56
- inject_plugin_ingestion_time field_name # inject the 13 digit epoch time at which the plugin ingested the event
56
+ inject_cloudwatch_ingestion_time field_name # inject the iso8601 `ingestion_time` as returned by the Cloudwatch API
57
+ inject_plugin_ingestion_time field_name # inject the iso8601 time at which the plugin ingested the event
57
58
  parse_json_body false # Attempt to parse the body as json and add structured fields from the result
58
59
  fail_on_unparsable_json false # If the body cannot be parsed as json do not ingest the record
59
60
  telemetry false # Produce statsd telemetry
@@ -100,6 +101,7 @@ api.calls.describeloggroups.attempted
100
101
  api.calls.describeloggroups.failed
101
102
  api.calls.describelogstreams.attempted
102
103
  api.calls.describelogstreams.failed
104
+ api.calls.describeloggroups.excluded # due to log_group_exclude_regexp
103
105
  api.calls.getlogevents.attempted
104
106
  api.calls.getlogevents.failed
105
107
  api.calls.getlogevents.invalid_token
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Ingest
5
- VERSION = '1.2.0'.freeze
5
+ VERSION = '1.3.0'.freeze
6
6
  end
7
7
  end
8
8
  end
@@ -24,6 +24,8 @@ module Fluent::Plugin
24
24
  config_param :log_group_name_prefix, :string, default: ''
25
25
  desc 'Log stream name or prefix. Not setting means "all"'
26
26
  config_param :log_stream_name_prefix, :string, default: ''
27
+ desc 'Log group regexp to exclude, despite matching'
28
+ config_param :log_group_exclude_regexp, :string, default: ''
27
29
  desc 'State file name'
28
30
  config_param :state_file_name, :string, default: '/var/spool/td-agent/cloudwatch.state' # rubocop:disable LineLength
29
31
  desc 'Fetch logs every interval'
@@ -158,7 +160,19 @@ module Fluent::Plugin
158
160
  )
159
161
  end
160
162
 
161
- response.log_groups.each { |g| log_groups << g.log_group_name }
163
+ regex = Regexp.new(@log_group_exclude_regexp)
164
+ response.log_groups.each do |group|
165
+ if !@log_group_exclude_regexp.empty?
166
+ if regex.match(group.log_group_name)
167
+ log.info("Excluding log_group #{group.log_group_name} due to log_group_exclude_regexp #{@log_group_exclude_regexp}") # rubocop:disable LineLength
168
+ metric(:increment, 'api.calls.describeloggroups.excluded')
169
+ else
170
+ log_groups << group.log_group_name
171
+ end
172
+ else
173
+ log_groups << group.log_group_name
174
+ end
175
+ end
162
176
  break unless response.next_token
163
177
  next_token = response.next_token
164
178
  rescue => boom
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-ingest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Pointer
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-18 00:00:00.000000000 Z
11
+ date: 2017-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler