logstash-input-cloudwatch_logs 1.0.0 → 1.0.1

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
  SHA1:
3
- metadata.gz: 49516d63ed0fba659dbe33edc4288c61c084659b
4
- data.tar.gz: 6004ebd1359d675c0bc166935d04038e530b3902
3
+ metadata.gz: 46906c7db7628771d3487566ba11d1987e05aa29
4
+ data.tar.gz: 5410ad160767b02f7390069b6461d937b51b789c
5
5
  SHA512:
6
- metadata.gz: 4ccdac70044254d0a8e2aadd333473a5eb5df37928507d5416975c915ab9905501f28601f2449519ea5e539f72eba7c3d3195938d165cb58acf349e33e9f8370
7
- data.tar.gz: c49abd01f34cdedd7448551f1d4d54fc597dade50e0e69de54afed29bef468e5424a72f8c23c16cbbf098b85a0ce08862027be99ef1a634290add64707d3e02d
6
+ metadata.gz: fe06db80935feed58856787ed6ef888ce566b5a3ff340cf0c7fe2e3db602db072ab6a83349b41a6d011bd06a62db931e809438876397bc0571d1b553e895761e
7
+ data.tar.gz: a47d4a612dae319daf23a1b30a5ece6c00e2ea2dec6e041806629687c8d15b1bf9da3be4ca86ce02946de4fc8ecdfafede89a9fe113607a4c6e709629c9d5005
@@ -5,6 +5,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [v1.0.1] (2017-08-22)
9
+
10
+ ### Fixed
11
+ * Handle rate limiting when making requests to the CWL apis ([#32](https://github.com/lukewaite/logstash-input-cloudwatch-logs/pull/32))
12
+
8
13
  ## [v1.0.0] (2017-07-15)
9
14
 
10
15
  ### Added
@@ -18,5 +23,6 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
18
23
  * Pull only log_events since last ingestion (Fixes [#10](https://github.com/lukewaite/logstash-input-cloudwatch-logs/issues/10))
19
24
  * Incrementally write to since_db on each page of data from the CWL API (Fixes [#4](https://github.com/lukewaite/logstash-input-cloudwatch-logs/issues/4))
20
25
 
21
- [Unreleased]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v1.0.0...HEAD
26
+ [Unreleased]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v1.0.1...HEAD
27
+ [v1.0.1]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v0.1.0.0...v1.0.1
22
28
  [v1.0.0]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v0.10.3...v1.0.0
@@ -110,16 +110,21 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
110
110
  public
111
111
  def run(queue)
112
112
  @queue = queue
113
+ @priority = []
113
114
  _sincedb_open
114
115
  determine_start_position(find_log_groups)
115
116
 
116
117
  while !stop?
117
- groups = find_log_groups
118
-
119
- groups.each do |group|
120
- @logger.debug("calling process_group on #{group}")
121
- process_group(group)
122
- end # groups.each
118
+ begin
119
+ groups = find_log_groups
120
+
121
+ groups.each do |group|
122
+ @logger.debug("calling process_group on #{group}")
123
+ process_group(group)
124
+ end # groups.each
125
+ rescue Aws::CloudWatchLogs::Errors::ThrottlingException
126
+ @logger.debug("reached rate limit")
127
+ end
123
128
 
124
129
  Stud.stoppable_sleep(@interval) { stop? }
125
130
  end
@@ -144,9 +149,15 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
144
149
  @logger.debug("log_group_prefix not enabled")
145
150
  groups = @log_group
146
151
  end
147
- groups
152
+ # Move the most recent groups to the end
153
+ groups.sort{|a,b| priority_of(a) <=> priority_of(b) }
148
154
  end # def find_log_groups
149
155
 
156
+ private
157
+ def priority_of(group)
158
+ @priority.index(group) || -1
159
+ end
160
+
150
161
  public
151
162
  def determine_start_position(groups)
152
163
  groups.each do |group|
@@ -189,6 +200,8 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
189
200
  next_token = resp.next_token
190
201
  break if next_token.nil?
191
202
  end
203
+ @priority.delete(group)
204
+ @priority << group
192
205
  end #def process_group
193
206
 
194
207
  # def process_log
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-input-cloudwatch_logs'
4
- s.version = '1.0.0'
4
+ s.version = '1.0.1'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = 'Stream events from CloudWatch Logs.'
7
7
  s.description = 'This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-cloudwatch_logs
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Luke Waite
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-15 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement