logstash-input-cloudwatch_logs 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -2
- data/README.md +60 -77
- data/lib/logstash/inputs/cloudwatch_logs.rb +10 -7
- data/logstash-input-cloudwatch_logs.gemspec +1 -1
- data/spec/inputs/cloudwatch_logs_spec.rb +13 -24
- metadata +2 -4
- data/spec/inputs/support/helpers.rb +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2a3f1c5f9e7ebf174d2b3bb7a3a1927008b63e4
|
4
|
+
data.tar.gz: a50af1d3b2ee8cb7638dbfc9bcc61551d5f30520
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7333fddf4c94aee0a1065bc4474d1918dc8aee47ae8a97a6eb197f1907b7db01b8ff2eab269e4fdaecc924f51b28a896c2073db2b13609d1daa6ed208b64dd87
|
7
|
+
data.tar.gz: 33a18253a79751a4ad3422042841667226d26a33738d4df687128e1c246f269a826c36c4bf5c9552b822475b0345bb7a85d638af776ef56e75f90a5500d51ef3
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
# Release Notes for `logstash-input-cloudwatch_logs`
|
2
2
|
|
3
|
-
## v0.10.
|
3
|
+
## v0.10.2 (2017-04-20)
|
4
|
+
|
5
|
+
### Fixed
|
6
|
+
* Fixed bad merge on [#eb38dfd](https://github.com/lukewaite/logstash-input-cloudwatch-logs/commit/eb38dfdc072b4fd21e9c1d83ea306e2b6c5df37b) and restore compatibility with the Logstash 5.x events API ([#21](https://github.com/lukewaite/logstash-input-cloudwatch-logs/pull/21))
|
7
|
+
|
8
|
+
## v0.10.1 (2017-04-19)
|
4
9
|
|
5
10
|
### Fixed
|
6
11
|
* Fixed issue [#16](https://github.com/lukewaite/logstash-input-cloudwatch-logs/issues/16) which prevented loading the plugin ([#17](https://github.com/lukewaite/logstash-input-cloudwatch-logs/pull/17))
|
@@ -36,4 +41,4 @@
|
|
36
41
|
## v0.9.0 (2015-07-06)
|
37
42
|
|
38
43
|
### Initial Release
|
39
|
-
* This is the initial release of the input
|
44
|
+
* This is the initial release of the input
|
data/README.md
CHANGED
@@ -1,79 +1,54 @@
|
|
1
|
-
# Logstash
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
##
|
19
|
-
|
20
|
-
###
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
53
|
-
```
|
54
|
-
- Install plugin
|
55
|
-
```sh
|
56
|
-
bin/plugin install --no-verify
|
57
|
-
```
|
58
|
-
- Run Logstash with your plugin
|
59
|
-
```sh
|
60
|
-
bin/logstash -e 'filter {awesome {}}'
|
61
|
-
```
|
62
|
-
At this point any modifications to the plugin code will be applied to this local Logstash setup. After modifying the plugin, simply rerun Logstash.
|
63
|
-
|
64
|
-
#### 2.2 Run in an installed Logstash
|
65
|
-
|
66
|
-
You can use the same **2.1** method to run your plugin in an installed Logstash by editing its `Gemfile` and pointing the `:path` to your local plugin development directory or you can build the gem and install it using:
|
67
|
-
|
68
|
-
- Build your plugin gem
|
69
|
-
```sh
|
70
|
-
gem build logstash-filter-awesome.gemspec
|
71
|
-
```
|
72
|
-
- Install the plugin from the Logstash home
|
73
|
-
```sh
|
74
|
-
bin/plugin install /your/local/plugin/logstash-filter-awesome.gem
|
75
|
-
```
|
76
|
-
- Start Logstash and proceed to test the plugin
|
1
|
+
# Logstash Input for CloudWatch Logs
|
2
|
+
|
3
|
+
[![Gem][ico-version]][link-rubygems]
|
4
|
+
[![Downloads][ico-downloads]][link-rubygems]
|
5
|
+
[![Software License][ico-license]](LICENSE.md)
|
6
|
+
[![Build Status][ico-travis]][link-travis]
|
7
|
+
|
8
|
+
> Stream events from CloudWatch Logs streams.
|
9
|
+
|
10
|
+
### Purpose
|
11
|
+
Specify an individual log group, and this plugin will scan
|
12
|
+
all log streams in that group, and pull in any new log events.
|
13
|
+
|
14
|
+
Optionally, you may set the `log_group_prefix` parameter to true
|
15
|
+
which will scan for all log groups matching the specified prefix
|
16
|
+
and ingest all logs available in all of the matching groups.
|
17
|
+
|
18
|
+
## Usage
|
19
|
+
|
20
|
+
### Parameters
|
21
|
+
| Parameter | Input Type | Required | Default |
|
22
|
+
|-----------|------------|----------|---------|
|
23
|
+
| log_group | string | Yes | |
|
24
|
+
| log_group_prefix | boolean | No | `false` |
|
25
|
+
| sincedb_path | string | No | `$HOME/.sincedb*` |
|
26
|
+
| interval | number | No | 60 |
|
27
|
+
| aws_credentials_file | string | No | |
|
28
|
+
| access_key_id | string | No | |
|
29
|
+
| secret_access_key | string | No | |
|
30
|
+
| session_token | string | No | |
|
31
|
+
| region | string | No | `us-east-1` |
|
32
|
+
| codec | string | No | `plain` |
|
33
|
+
|
34
|
+
Other standard logstash parameters are available such as:
|
35
|
+
* `add_field`
|
36
|
+
* `type`
|
37
|
+
* `tags`
|
38
|
+
|
39
|
+
### Example
|
40
|
+
|
41
|
+
input {
|
42
|
+
cloudwatch_logs {
|
43
|
+
log_group => "/aws/lambda/my-lambda"
|
44
|
+
access_key_id => "AKIAXXXXXX"
|
45
|
+
secret_access_key => "SECRET"
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
## Development
|
50
|
+
The [default logstash README](docs/Logstash%20Plugin%20Development.md) which contains development directions and other information has been moved to the [`docs`](docs/)
|
51
|
+
directory.
|
77
52
|
|
78
53
|
## Contributing
|
79
54
|
|
@@ -83,4 +58,12 @@ Programming is not a required skill. Whatever you've seen about open source and
|
|
83
58
|
|
84
59
|
It is more important to the community that you are able to contribute.
|
85
60
|
|
86
|
-
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
61
|
+
For more information about contributing, see the [CONTRIBUTING](https://github.com/elasticsearch/logstash/blob/master/CONTRIBUTING.md) file.
|
62
|
+
|
63
|
+
[ico-version]: https://img.shields.io/gem/v/logstash-input-cloudwatch_logs.svg?style=flat-square
|
64
|
+
[ico-downloads]: https://img.shields.io/gem/dt/logstash-input-cloudwatch_logs.svg?style=flat-square
|
65
|
+
[ico-license]: https://img.shields.io/badge/License-Apache%202.0-blue.svg?style=flat-square
|
66
|
+
[ico-travis]: https://img.shields.io/travis/lukewaite/logstash-input-cloudwatch-logs.svg?style=flat-square
|
67
|
+
|
68
|
+
[link-rubygems]: https://rubygems.org/gems/logstash-input-cloudwatch_logs
|
69
|
+
[link-travis]: https://travis-ci.org/lukewaite/logstash-input-cloudwatch_logs
|
@@ -12,12 +12,15 @@ require "logstash/inputs/cloudwatch/patch"
|
|
12
12
|
|
13
13
|
Aws.eager_autoload!
|
14
14
|
|
15
|
-
# Stream events from
|
15
|
+
# Stream events from CloudWatch Logs streams.
|
16
16
|
#
|
17
|
-
#
|
18
|
-
# CloudWatch Logs. Specify a log group, and this plugin will scan
|
17
|
+
# Specify an individual log group, and this plugin will scan
|
19
18
|
# all log streams in that group, and pull in any new log events.
|
20
19
|
#
|
20
|
+
# Optionally, you may set the `log_group_prefix` parameter to true
|
21
|
+
# which will scan for all log groups matching the specified prefix
|
22
|
+
# and ingest all logs available in all of the matching groups.
|
23
|
+
#
|
21
24
|
class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
|
22
25
|
include LogStash::PluginMixins::AwsConfig::V2
|
23
26
|
|
@@ -30,7 +33,7 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
|
|
30
33
|
config :log_group, :validate => :string, :required => true
|
31
34
|
|
32
35
|
# Where to write the since database (keeps track of the date
|
33
|
-
# the last handled
|
36
|
+
# the last handled log stream was updated). The default will write
|
34
37
|
# sincedb files to some path matching "$HOME/.sincedb*"
|
35
38
|
# Should be a path with filename not just a directory.
|
36
39
|
config :sincedb_path, :validate => :string, :default => nil
|
@@ -121,9 +124,9 @@ class LogStash::Inputs::CloudWatch_Logs < LogStash::Inputs::Base
|
|
121
124
|
|
122
125
|
@codec.decode(log.message.to_str) do |event|
|
123
126
|
event.set("@timestamp", parse_time(log.timestamp))
|
124
|
-
event
|
125
|
-
event
|
126
|
-
event
|
127
|
+
event.set("[cloudwatch][ingestion_time]", parse_time(log.ingestion_time))
|
128
|
+
event.set("[cloudwatch][log_group]", stream.arn.split(/:/)[6])
|
129
|
+
event.set("[cloudwatch][log_stream]", stream.log_stream_name)
|
127
130
|
decorate(event)
|
128
131
|
|
129
132
|
queue << event
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-input-cloudwatch_logs'
|
4
|
-
s.version = '0.10.
|
4
|
+
s.version = '0.10.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'
|
@@ -1,37 +1,26 @@
|
|
1
1
|
# encoding: utf-8
|
2
2
|
require "logstash/devutils/rspec/spec_helper"
|
3
3
|
require "logstash/inputs/cloudwatch_logs"
|
4
|
-
require "logstash/errors"
|
5
|
-
require "aws-sdk-resources"
|
6
|
-
require_relative "./support/helpers"
|
7
4
|
|
8
5
|
describe LogStash::Inputs::CloudWatch_Logs do
|
9
|
-
let(:sincedb_path) { Stud::Temporary.pathname }
|
10
|
-
let(:day) { 3600 * 24 }
|
11
|
-
let(:creds) { Aws::Credentials.new('1234', 'secret') }
|
12
|
-
let(:config) {
|
13
|
-
{
|
14
|
-
"access_key_id" => "1234",
|
15
|
-
"secret_access_key" => "secret",
|
16
|
-
"log_group" => "logstash-test-group",
|
17
|
-
"sincedb_path" => File.join(sincedb_path, ".sincedb")
|
18
|
-
}
|
19
|
-
}
|
20
|
-
|
21
6
|
before do
|
22
|
-
FileUtils.mkdir_p(sincedb_path)
|
23
7
|
Aws.config[:stub_responses] = true
|
24
8
|
Thread.abort_on_exception = true
|
25
9
|
end
|
26
10
|
|
27
|
-
|
28
|
-
let(:config) {
|
11
|
+
describe '#register' do
|
12
|
+
let(:config) {
|
13
|
+
{
|
14
|
+
'access_key_id' => '1234',
|
15
|
+
'secret_access_key' => 'secret',
|
16
|
+
'log_group' => 'sample-log-group',
|
17
|
+
'region' => 'us-east-1'
|
18
|
+
}
|
19
|
+
}
|
20
|
+
subject {LogStash::Inputs::CloudWatch_Logs.new(config)}
|
29
21
|
|
30
|
-
|
31
|
-
|
22
|
+
it "registers succesfully" do
|
23
|
+
expect {subject.register}.to_not raise_error
|
32
24
|
end
|
33
|
-
|
34
|
-
it_behaves_like "an interruptible input plugin"
|
35
25
|
end
|
36
|
-
|
37
|
-
end
|
26
|
+
end
|
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: 0.10.
|
4
|
+
version: 0.10.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-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -88,7 +88,6 @@ files:
|
|
88
88
|
- lib/logstash/inputs/cloudwatch_logs.rb
|
89
89
|
- logstash-input-cloudwatch_logs.gemspec
|
90
90
|
- spec/inputs/cloudwatch_logs_spec.rb
|
91
|
-
- spec/inputs/support/helpers.rb
|
92
91
|
homepage: ''
|
93
92
|
licenses:
|
94
93
|
- Apache License (2.0)
|
@@ -117,4 +116,3 @@ specification_version: 4
|
|
117
116
|
summary: Stream events from CloudWatch Logs.
|
118
117
|
test_files:
|
119
118
|
- spec/inputs/cloudwatch_logs_spec.rb
|
120
|
-
- spec/inputs/support/helpers.rb
|