fluent-plugin-cloudwatch-logs 0.7.1 → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d6ac14d761ae8cfffe1fd6cc11abdc282861f8639924776117c6773a4599057a
4
- data.tar.gz: 933cc8a97a346ade8287f5fbfc339aa2340a8982c3252cf822a9b95d70c0c78f
3
+ metadata.gz: bde5b7cd1595dd2fc007de30ed34cbd38e635f9c1532f476f7dca0cabb3af12a
4
+ data.tar.gz: dafcdd1336e06c808600229c56b504e0f2d4766011b34e480973a203945a4fe3
5
5
  SHA512:
6
- metadata.gz: 64c6c225b57fe907a6ac9e1941d3cb3a1c0356096aeda2e9213bee288e479c18ed33d73eea754a58474d60e818f6c6ce7f33f5efa0b339c663d3a84f743d8ccf
7
- data.tar.gz: 5300d8d29f83242479ac2f38c8bdf26bacd3d8dd353f8b286eb593912671ec6143ad26ff3640affbd33293ae07cea1b9bf3d22dcbe0eb81acb2ffc5564cc0aec
6
+ metadata.gz: d02acdf6785f10b98201d4fc886a88548c7c7468edc94c3b6d81490815955ee3e52b3c9aa2a67c4931a693bb877fa9daf8500986bf29a888573b1e6f44535786
7
+ data.tar.gz: 9c32ce072ea6d62a87468ed42cd90be1cee412d3a1caa7665148c7fdac3a148d0bb263295c725689b1e0a5e82ef39cd032eb8ae12d32cf3740dc59973169429b
data/README.md CHANGED
@@ -4,6 +4,15 @@
4
4
 
5
5
  [CloudWatch Logs](http://aws.amazon.com/blogs/aws/cloudwatch-log-service/) Plugin for Fluentd
6
6
 
7
+ ## Requirements
8
+
9
+ |fluent-plugin-cloudwatch-logs| fluentd | ruby |
10
+ |-----------------------------|------------------|--------|
11
+ | >= 0.5.0 | >= 0.14.15 | >= 2.1 |
12
+ | <= 0.4.5 | ~> 0.12.0 * | >= 1.9 |
13
+
14
+ * May not support all future fluentd features
15
+
7
16
  ## Installation
8
17
 
9
18
  $ gem install fluent-plugin-cloudwatch-logs
@@ -84,6 +93,7 @@ Fetch sample log from CloudWatch Logs:
84
93
  #put_log_events_disable_retry_limit false
85
94
  #endpoint http://localhost:5000/
86
95
  #json_handler json
96
+ #log_rejected_request true
87
97
  </match>
88
98
  ```
89
99
 
@@ -106,6 +116,7 @@ Fetch sample log from CloudWatch Logs:
106
116
  * `put_log_events_disable_retry_limit`: if true, `put_log_events_retry_limit` will be ignored
107
117
  * `endpoint`: use this parameter to connect to the local API endpoint (for testing)
108
118
  * `json_handler`: name of the library to be used to handle JSON data. For now, supported libraries are `json` (default) and `yajl`.
119
+ * `log_rejected_request`: output `rejected_log_events_info` request log. (defaults to false)
109
120
 
110
121
  ### in_cloudwatch_logs
111
122
 
@@ -2,7 +2,7 @@ module Fluent
2
2
  module Plugin
3
3
  module Cloudwatch
4
4
  module Logs
5
- VERSION = "0.7.1"
5
+ VERSION = "0.7.2"
6
6
  end
7
7
  end
8
8
  end
@@ -43,6 +43,7 @@ module Fluent::Plugin
43
43
  config_param :retention_in_days_key, :string, default: nil
44
44
  config_param :remove_retention_in_days, :bool, default: false
45
45
  config_param :json_handler, :enum, list: [:yajl, :json], :default => :yajl
46
+ config_param :log_rejected_resquest, :bool, :default => false
46
47
 
47
48
  config_section :buffer do
48
49
  config_set_default :@type, DEFAULT_BUFFER_TYPE
@@ -326,8 +327,7 @@ module Fluent::Plugin
326
327
  begin
327
328
  t = Time.now
328
329
  response = @logs.put_log_events(args)
329
- log.warn response.rejected_log_events_info if response.rejected_log_events_info != nil
330
- log.debug "Called PutLogEvents API", {
330
+ request = {
331
331
  "group" => group_name,
332
332
  "stream" => stream_name,
333
333
  "events_count" => events.size,
@@ -336,6 +336,12 @@ module Fluent::Plugin
336
336
  "thread" => Thread.current.object_id,
337
337
  "request_sec" => Time.now - t,
338
338
  }
339
+ if response.rejected_log_events_info != nil && @log_rejected_request
340
+ log.warn response.rejected_log_events_info
341
+ log.warn "Called PutLogEvents API", request
342
+ else
343
+ log.debug "Called PutLogEvents API", request
344
+ end
339
345
  rescue Aws::CloudWatchLogs::Errors::InvalidSequenceTokenException, Aws::CloudWatchLogs::Errors::DataAlreadyAcceptedException => err
340
346
  sleep 1 # to avoid too many API calls
341
347
  log_stream = find_log_stream(group_name, stream_name)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-cloudwatch-logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.1
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryota Arai
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-02 00:00:00.000000000 Z
11
+ date: 2019-01-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd
@@ -135,8 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubyforge_project:
139
- rubygems_version: 2.7.6
138
+ rubygems_version: 3.0.1
140
139
  signing_key:
141
140
  specification_version: 4
142
141
  summary: CloudWatch Logs Plugin for Fluentd