logstash-input-cloudwatch_logs 1.0.1 → 1.0.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
  SHA1:
3
- metadata.gz: 46906c7db7628771d3487566ba11d1987e05aa29
4
- data.tar.gz: 5410ad160767b02f7390069b6461d937b51b789c
3
+ metadata.gz: 2a587c56f57c85fdc6648aeaa11d92ae64b49ede
4
+ data.tar.gz: a8c310272ecbca4cad0248be82cad07184c872ce
5
5
  SHA512:
6
- metadata.gz: fe06db80935feed58856787ed6ef888ce566b5a3ff340cf0c7fe2e3db602db072ab6a83349b41a6d011bd06a62db931e809438876397bc0571d1b553e895761e
7
- data.tar.gz: a47d4a612dae319daf23a1b30a5ece6c00e2ea2dec6e041806629687c8d15b1bf9da3be4ca86ce02946de4fc8ecdfafede89a9fe113607a4c6e709629c9d5005
6
+ metadata.gz: 9f22f8fadda6aaaa2ed9cb78b279e1fbe0b2377fece1c2874126f741d5fc2dded2bfc3b034384ce09b4b215e7acf99abfb9a26c9599a5d73fb89e9e17aaeb6ad
7
+ data.tar.gz: e76d7d4af72c4c0db4aa983a4778a604d14c132367601cd88e95aa591a7b93da6c82b96a664bf7a64c2e079364b6eb2853374a8d5785c64e772f59aa849502e6
@@ -5,6 +5,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [v1.0.2] (2017-10-07)
9
+ * Handle a `start_position` integer value correctly ([#41](https://github.com/lukewaite/logstash-input-cloudwatch-logs/pull/41) - Fixes [#38](https://github.com/lukewaite/logstash-input-cloudwatch-logs/issues/38))
10
+
8
11
  ## [v1.0.1] (2017-08-22)
9
12
 
10
13
  ### Fixed
@@ -23,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
23
26
  * Pull only log_events since last ingestion (Fixes [#10](https://github.com/lukewaite/logstash-input-cloudwatch-logs/issues/10))
24
27
  * 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))
25
28
 
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
29
+ [Unreleased]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v1.0.2...HEAD
30
+ [v1.0.1]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v1.0.1...v1.0.2
31
+ [v1.0.1]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v1.0.0...v1.0.1
28
32
  [v1.0.0]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/v0.10.3...v1.0.0
data/README.md CHANGED
@@ -60,8 +60,7 @@ Other standard logstash parameters are available such as:
60
60
  }
61
61
 
62
62
  ## Development
63
- The [default logstash README](docs/Logstash%20Plugin%20Development.md) which contains development directions and other information has been moved to the [`docs`](docs/)
64
- directory.
63
+ The [default logstash README](DEVELOPER.md) which contains development directions and other information has been moved to [DEVELOPER.md](DEVELOPER.md).
65
64
 
66
65
  ## Contributing
67
66
 
@@ -112,7 +112,7 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
112
112
  @queue = queue
113
113
  @priority = []
114
114
  _sincedb_open
115
- determine_start_position(find_log_groups)
115
+ determine_start_position(find_log_groups, @sincedb)
116
116
 
117
117
  while !stop?
118
118
  begin
@@ -159,18 +159,18 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
159
159
  end
160
160
 
161
161
  public
162
- def determine_start_position(groups)
162
+ def determine_start_position(groups, sincedb)
163
163
  groups.each do |group|
164
- if !@sincedb.member?(group)
164
+ if !sincedb.member?(group)
165
165
  case @start_position
166
166
  when 'beginning'
167
- @sincedb[group] = 0
167
+ sincedb[group] = 0
168
168
 
169
169
  when 'end'
170
- @sincedb[group] = DateTime.now.strftime('%Q')
170
+ sincedb[group] = DateTime.now.strftime('%Q')
171
171
 
172
172
  else
173
- @sincedb[group] = DateTime.now.strftime('%Q') - (@start_position * 1000)
173
+ sincedb[group] = DateTime.now.strftime('%Q').to_i - (@start_position * 1000)
174
174
  end # case @start_position
175
175
  end
176
176
  end
@@ -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.1'
4
+ s.version = '1.0.2'
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'
@@ -83,6 +83,17 @@ describe LogStash::Inputs::CloudWatch_Logs do
83
83
  end
84
84
  end
85
85
 
86
+ describe '#determine_start_position' do
87
+ context 'start_position set to an integer' do
88
+ sincedb = {}
89
+ subject {LogStash::Inputs::CloudWatch_Logs.new(config.merge({'start_position' => 100}))}
90
+
91
+ it 'successfully parses the start position' do
92
+ expect {subject.determine_start_position(['test'], sincedb)}.to_not raise_error
93
+ end
94
+ end
95
+ end
96
+
86
97
  # describe '#find_log_groups with prefix true' do
87
98
  # subject {LogStash::Inputs::CloudWatch_Logs.new(config.merge({'log_group_prefix' => true}))}
88
99
  #
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.1
4
+ version: 1.0.2
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-08-22 00:00:00.000000000 Z
11
+ date: 2017-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement