logstash-output-cloudwatch 2.0.4 → 3.0.0
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 +2 -0
- data/Gemfile +3 -1
- data/LICENSE +1 -1
- data/README.md +12 -3
- data/lib/logstash/outputs/cloudwatch.rb +19 -21
- data/logstash-output-cloudwatch.gemspec +4 -5
- metadata +22 -34
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c0b13f472d66ba03bb414067b32c83a9eb758cc1
|
4
|
+
data.tar.gz: 72a7d4d9002a372fc59984ffb4d6cc55212c6177
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9ecb2fb1ba1d3816fead3ae4c813002190fa174bfcde1ad4f238b2e7d573a3985f0a0cedfc78ded803319fb3343f91d4527e10f5b0d1ae88996e0acbcf019861
|
7
|
+
data.tar.gz: cb8e7f4d1ca48a1b202923b7077f51324182664b7bdd8bd078e2f0f3544c72a31f27f447b65e2083ccb8968a486a5f26762082ca22e9b94459913afdcb4b637a
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
- Update the plugin to the version 2.0 of the plugin api, this change is required for Logstash 5.0 compatibility. See https://github.com/elastic/logstash/issues/5141
|
1
3
|
# 2.0.4
|
2
4
|
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
|
3
5
|
# 2.0.3
|
data/Gemfile
CHANGED
data/LICENSE
CHANGED
data/README.md
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
-
[](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Outputs/job/logstash-plugin-output-cloudwatch-unit/)
|
3
|
+
[](https://travis-ci.org/logstash-plugins/logstash-output-cloudwatch)
|
5
4
|
|
6
5
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
7
6
|
|
@@ -56,7 +55,12 @@ gem "logstash-filter-awesome", :path => "/your/local/logstash-filter-awesome"
|
|
56
55
|
```
|
57
56
|
- Install plugin
|
58
57
|
```sh
|
58
|
+
# Logstash 2.3 and higher
|
59
|
+
bin/logstash-plugin install --no-verify
|
60
|
+
|
61
|
+
# Prior to Logstash 2.3
|
59
62
|
bin/plugin install --no-verify
|
63
|
+
|
60
64
|
```
|
61
65
|
- Run Logstash with your plugin
|
62
66
|
```sh
|
@@ -74,7 +78,12 @@ gem build logstash-filter-awesome.gemspec
|
|
74
78
|
```
|
75
79
|
- Install the plugin from the Logstash home
|
76
80
|
```sh
|
77
|
-
|
81
|
+
# Logstash 2.3 and higher
|
82
|
+
bin/logstash-plugin install --no-verify
|
83
|
+
|
84
|
+
# Prior to Logstash 2.3
|
85
|
+
bin/plugin install --no-verify
|
86
|
+
|
78
87
|
```
|
79
88
|
- Start Logstash and proceed to test the plugin
|
80
89
|
|
@@ -61,8 +61,8 @@ require "logstash/plugin_mixins/aws_config"
|
|
61
61
|
# and the specific of API endpoint this output uses,
|
62
62
|
# http://docs.amazonwebservices.com/AmazonCloudWatch/latest/APIReference/API_PutMetricData.html[PutMetricData]
|
63
63
|
class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
64
|
-
include LogStash::PluginMixins::AwsConfig
|
65
|
-
|
64
|
+
include LogStash::PluginMixins::AwsConfig::V2
|
65
|
+
|
66
66
|
config_name "cloudwatch"
|
67
67
|
|
68
68
|
# Constants
|
@@ -92,6 +92,9 @@ class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
|
92
92
|
# Set this to the number of events-per-timeframe you will be sending to CloudWatch to avoid extra API calls
|
93
93
|
config :queue_size, :validate => :number, :default => 10000
|
94
94
|
|
95
|
+
# How many data points can be given in one call to the CloudWatch API
|
96
|
+
config :batch_size, :validate => :number, :default => 20
|
97
|
+
|
95
98
|
# The default namespace to use for events which do not have a `CW_namespace` field
|
96
99
|
config :namespace, :validate => :string, :default => "Logstash"
|
97
100
|
|
@@ -151,20 +154,13 @@ class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
|
151
154
|
# `add_field => [ "CW_dimensions", "prod" ]`
|
152
155
|
config :field_dimensions, :validate => :string, :default => "CW_dimensions"
|
153
156
|
|
154
|
-
public
|
155
|
-
def aws_service_endpoint(region)
|
156
|
-
return {
|
157
|
-
:cloud_watch_endpoint => "monitoring.#{region}.amazonaws.com"
|
158
|
-
}
|
159
|
-
end
|
160
|
-
|
161
157
|
public
|
162
158
|
def register
|
163
159
|
require "thread"
|
164
160
|
require "rufus/scheduler"
|
165
|
-
require "aws"
|
161
|
+
require "aws-sdk"
|
166
162
|
|
167
|
-
@cw =
|
163
|
+
@cw = Aws::CloudWatch::Client.new(aws_options_hash)
|
168
164
|
|
169
165
|
@event_queue = SizedQueue.new(@queue_size)
|
170
166
|
@scheduler = Rufus::Scheduler.new
|
@@ -185,7 +181,7 @@ class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
|
185
181
|
return
|
186
182
|
end
|
187
183
|
|
188
|
-
return unless (event
|
184
|
+
return unless (event.get(@field_metricname) || @metricname)
|
189
185
|
|
190
186
|
if (@event_queue.length >= @event_queue.max)
|
191
187
|
@job.trigger
|
@@ -225,15 +221,17 @@ class LogStash::Outputs::CloudWatch < LogStash::Outputs::Base
|
|
225
221
|
metric_data << new_data
|
226
222
|
end # data.each
|
227
223
|
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
224
|
+
metric_data.each_slice(@batch_size) do |batch|
|
225
|
+
begin
|
226
|
+
@cw.put_metric_data(
|
227
|
+
:namespace => namespace,
|
228
|
+
:metric_data => batch
|
229
|
+
)
|
230
|
+
@logger.info("Sent data to AWS CloudWatch OK", :namespace => namespace, :metric_data => batch)
|
231
|
+
rescue Exception => e
|
232
|
+
@logger.warn("Failed to send to AWS CloudWatch", :exception => e, :namespace => namespace, :metric_data => batch)
|
233
|
+
break
|
234
|
+
end
|
237
235
|
end
|
238
236
|
end # aggregates.each
|
239
237
|
return aggregates
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-output-cloudwatch'
|
4
|
-
s.version = '
|
4
|
+
s.version = '3.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This output lets you aggregate and send metric data to AWS CloudWatch"
|
7
|
-
s.description = "This gem is a
|
7
|
+
s.description = "This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program"
|
8
8
|
s.authors = ["Elastic"]
|
9
9
|
s.email = 'info@elastic.co'
|
10
10
|
s.homepage = "http://www.elastic.co/guide/en/logstash/current/index.html"
|
@@ -20,10 +20,9 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "output" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency "logstash-core-plugin-api", "~>
|
24
|
-
s.add_runtime_dependency 'logstash-mixin-aws'
|
23
|
+
s.add_runtime_dependency "logstash-core-plugin-api", "~> 2.0"
|
24
|
+
s.add_runtime_dependency 'logstash-mixin-aws', '>= 1.0.0'
|
25
25
|
s.add_runtime_dependency 'rufus-scheduler', [ '~> 3.0.9' ]
|
26
|
-
s.add_runtime_dependency 'aws-sdk'
|
27
26
|
|
28
27
|
s.add_development_dependency 'logstash-devutils'
|
29
28
|
end
|
metadata
CHANGED
@@ -1,86 +1,74 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-output-cloudwatch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
+
name: logstash-core-plugin-api
|
14
15
|
requirement: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - "~>"
|
17
18
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
19
|
-
name: logstash-core-plugin-api
|
20
|
-
prerelease: false
|
19
|
+
version: '2.0'
|
21
20
|
type: :runtime
|
21
|
+
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '2.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
+
name: logstash-mixin-aws
|
28
29
|
requirement: !ruby/object:Gem::Requirement
|
29
30
|
requirements:
|
30
31
|
- - ">="
|
31
32
|
- !ruby/object:Gem::Version
|
32
|
-
version:
|
33
|
-
name: logstash-mixin-aws
|
34
|
-
prerelease: false
|
33
|
+
version: 1.0.0
|
35
34
|
type: :runtime
|
35
|
+
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.0.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
+
name: rufus-scheduler
|
42
43
|
requirement: !ruby/object:Gem::Requirement
|
43
44
|
requirements:
|
44
45
|
- - "~>"
|
45
46
|
- !ruby/object:Gem::Version
|
46
47
|
version: 3.0.9
|
47
|
-
name: rufus-scheduler
|
48
|
-
prerelease: false
|
49
48
|
type: :runtime
|
49
|
+
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 3.0.9
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
+
name: logstash-devutils
|
56
57
|
requirement: !ruby/object:Gem::Requirement
|
57
58
|
requirements:
|
58
59
|
- - ">="
|
59
60
|
- !ruby/object:Gem::Version
|
60
61
|
version: '0'
|
61
|
-
name: aws-sdk
|
62
|
-
prerelease: false
|
63
|
-
type: :runtime
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - ">="
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
requirement: !ruby/object:Gem::Requirement
|
71
|
-
requirements:
|
72
|
-
- - ">="
|
73
|
-
- !ruby/object:Gem::Version
|
74
|
-
version: '0'
|
75
|
-
name: logstash-devutils
|
76
|
-
prerelease: false
|
77
62
|
type: :development
|
63
|
+
prerelease: false
|
78
64
|
version_requirements: !ruby/object:Gem::Requirement
|
79
65
|
requirements:
|
80
66
|
- - ">="
|
81
67
|
- !ruby/object:Gem::Version
|
82
68
|
version: '0'
|
83
|
-
description: This gem is a
|
69
|
+
description: This gem is a Logstash plugin required to be installed on top of the
|
70
|
+
Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
|
71
|
+
gem is not a stand-alone program
|
84
72
|
email: info@elastic.co
|
85
73
|
executables: []
|
86
74
|
extensions: []
|
@@ -101,7 +89,7 @@ licenses:
|
|
101
89
|
metadata:
|
102
90
|
logstash_plugin: 'true'
|
103
91
|
logstash_group: output
|
104
|
-
post_install_message:
|
92
|
+
post_install_message:
|
105
93
|
rdoc_options: []
|
106
94
|
require_paths:
|
107
95
|
- lib
|
@@ -116,9 +104,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
116
104
|
- !ruby/object:Gem::Version
|
117
105
|
version: '0'
|
118
106
|
requirements: []
|
119
|
-
rubyforge_project:
|
120
|
-
rubygems_version: 2.
|
121
|
-
signing_key:
|
107
|
+
rubyforge_project:
|
108
|
+
rubygems_version: 2.5.1
|
109
|
+
signing_key:
|
122
110
|
specification_version: 4
|
123
111
|
summary: This output lets you aggregate and send metric data to AWS CloudWatch
|
124
112
|
test_files:
|