logstash-input-cloudwatch_logs 1.0.1 → 1.0.2
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 +4 -4
- data/CHANGELOG.md +6 -2
- data/README.md +1 -2
- data/lib/logstash/inputs/cloudwatch_logs.rb +6 -6
- data/logstash-input-cloudwatch_logs.gemspec +1 -1
- data/spec/inputs/cloudwatch_logs_spec.rb +11 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a587c56f57c85fdc6648aeaa11d92ae64b49ede
|
4
|
+
data.tar.gz: a8c310272ecbca4cad0248be82cad07184c872ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9f22f8fadda6aaaa2ed9cb78b279e1fbe0b2377fece1c2874126f741d5fc2dded2bfc3b034384ce09b4b215e7acf99abfb9a26c9599a5d73fb89e9e17aaeb6ad
|
7
|
+
data.tar.gz: e76d7d4af72c4c0db4aa983a4778a604d14c132367601cd88e95aa591a7b93da6c82b96a664bf7a64c2e079364b6eb2853374a8d5785c64e772f59aa849502e6
|
data/CHANGELOG.md
CHANGED
@@ -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.
|
27
|
-
[v1.0.1]: https://github.com/lukewaite/logstash-input-cloudwatch-logs/compare/
|
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](
|
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
|
164
|
+
if !sincedb.member?(group)
|
165
165
|
case @start_position
|
166
166
|
when 'beginning'
|
167
|
-
|
167
|
+
sincedb[group] = 0
|
168
168
|
|
169
169
|
when 'end'
|
170
|
-
|
170
|
+
sincedb[group] = DateTime.now.strftime('%Q')
|
171
171
|
|
172
172
|
else
|
173
|
-
|
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.
|
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.
|
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-
|
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
|