logstash-filter-metrics 4.0.2 → 4.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile +8 -1
- data/docs/index.asciidoc +228 -0
- data/logstash-filter-metrics.gemspec +2 -2
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ae073bd8a88f8fdc36369ac0fbc804e2da56f23e
|
4
|
+
data.tar.gz: 8f9f726f6edb421cb0e52eb891cf123bf12dd720
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 10c21adaf28dc15b484a915c29217a8a5e1861a8bbbd77a020857fc587927197fc0e4dc6040513a77ff4fd634878d69159ccb6c44efb659d1322b38d90d6cb98
|
7
|
+
data.tar.gz: 2b8823c3a5ed75523097408c792193f4b5d08ab84aa9726f2cf65b6b67a93275537cd1ebaac8ed71f9ecbee8218959f738c9161f3aad1e8f617b4a23294ac047
|
data/CHANGELOG.md
CHANGED
@@ -3,12 +3,16 @@
|
|
3
3
|
|
4
4
|
## 4.0.1
|
5
5
|
- Republish all the gems under jruby.
|
6
|
+
|
6
7
|
## 4.0.0
|
7
8
|
- 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
|
9
|
+
|
8
10
|
# 3.0.2
|
9
11
|
- Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
|
12
|
+
|
10
13
|
# 3.0.1
|
11
14
|
- New dependency requirements for logstash-core for the 5.0 release
|
15
|
+
|
12
16
|
## 3.0.0
|
13
17
|
- Elasticsearch 2.0 does not allow for dots in field names. This change changes to use sub-field syntax instead of
|
14
18
|
dotted syntax. This is a breaking change.
|
data/Gemfile
CHANGED
@@ -1,4 +1,11 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in logstash-mass_effect.gemspec
|
4
3
|
gemspec
|
4
|
+
|
5
|
+
logstash_path = ENV["LOGSTASH_PATH"] || "../../logstash"
|
6
|
+
use_logstash_source = ENV["LOGSTASH_SOURCE"] && ENV["LOGSTASH_SOURCE"].to_s == "1"
|
7
|
+
|
8
|
+
if Dir.exist?(logstash_path) && use_logstash_source
|
9
|
+
gem 'logstash-core', :path => "#{logstash_path}/logstash-core"
|
10
|
+
gem 'logstash-core-plugin-api', :path => "#{logstash_path}/logstash-core-plugin-api"
|
11
|
+
end
|
data/docs/index.asciidoc
ADDED
@@ -0,0 +1,228 @@
|
|
1
|
+
:plugin: metrics
|
2
|
+
:type: filter
|
3
|
+
|
4
|
+
///////////////////////////////////////////
|
5
|
+
START - GENERATED VARIABLES, DO NOT EDIT!
|
6
|
+
///////////////////////////////////////////
|
7
|
+
:version: %VERSION%
|
8
|
+
:release_date: %RELEASE_DATE%
|
9
|
+
:changelog_url: %CHANGELOG_URL%
|
10
|
+
:include_path: ../../../../logstash/docs/include
|
11
|
+
///////////////////////////////////////////
|
12
|
+
END - GENERATED VARIABLES, DO NOT EDIT!
|
13
|
+
///////////////////////////////////////////
|
14
|
+
|
15
|
+
[id="plugins-{type}-{plugin}"]
|
16
|
+
|
17
|
+
=== Metrics filter plugin
|
18
|
+
|
19
|
+
include::{include_path}/plugin_header.asciidoc[]
|
20
|
+
|
21
|
+
==== Description
|
22
|
+
|
23
|
+
The metrics filter is useful for aggregating metrics.
|
24
|
+
|
25
|
+
IMPORTANT: Elasticsearch 2.0 no longer allows field names with dots. Version 3.0
|
26
|
+
of the metrics filter plugin changes behavior to use nested fields rather than
|
27
|
+
dotted notation to avoid colliding with versions of Elasticsearch 2.0+. Please
|
28
|
+
note the changes in the documentation (underscores and sub-fields used).
|
29
|
+
|
30
|
+
For example, if you have a field `response` that is
|
31
|
+
a http response code, and you want to count each
|
32
|
+
kind of response, you can do this:
|
33
|
+
[source,ruby]
|
34
|
+
filter {
|
35
|
+
metrics {
|
36
|
+
meter => [ "http_%{response}" ]
|
37
|
+
add_tag => "metric"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
|
41
|
+
Metrics are flushed every 5 seconds by default or according to
|
42
|
+
`flush_interval`. Metrics appear as
|
43
|
+
new events in the event stream and go through any filters
|
44
|
+
that occur after as well as outputs.
|
45
|
+
|
46
|
+
In general, you will want to add a tag to your metrics and have an output
|
47
|
+
explicitly look for that tag.
|
48
|
+
|
49
|
+
The event that is flushed will include every 'meter' and 'timer'
|
50
|
+
metric in the following way:
|
51
|
+
|
52
|
+
==== `meter` values
|
53
|
+
|
54
|
+
For a `meter => "something"` you will receive the following fields:
|
55
|
+
|
56
|
+
* "[thing][count]" - the total count of events
|
57
|
+
* "[thing][rate_1m]" - the per-second event rate in a 1-minute sliding window
|
58
|
+
* "[thing][rate_5m]" - the per-second event rate in a 5-minute sliding window
|
59
|
+
* "[thing][rate_15m]" - the per-second event rate in a 15-minute sliding window
|
60
|
+
|
61
|
+
==== `timer` values
|
62
|
+
|
63
|
+
For a `timer => [ "thing", "%{duration}" ]` you will receive the following fields:
|
64
|
+
|
65
|
+
* "[thing][count]" - the total count of events
|
66
|
+
* "[thing][rate_1m]" - the per-second event rate in a 1-minute sliding window
|
67
|
+
* "[thing][rate_5m]" - the per-second event rate in a 5-minute sliding window
|
68
|
+
* "[thing][rate_15m]" - the per-second event rate in a 15-minute sliding window
|
69
|
+
* "[thing][min]" - the minimum value seen for this metric
|
70
|
+
* "[thing][max]" - the maximum value seen for this metric
|
71
|
+
* "[thing][stddev]" - the standard deviation for this metric
|
72
|
+
* "[thing][mean]" - the mean for this metric
|
73
|
+
* "[thing][pXX]" - the XXth percentile for this metric (see `percentiles`)
|
74
|
+
|
75
|
+
The default lengths of the event rate window (1, 5, and 15 minutes)
|
76
|
+
can be configured with the `rates` option.
|
77
|
+
|
78
|
+
==== Example: Computing event rate
|
79
|
+
|
80
|
+
For a simple example, let's track how many events per second are running
|
81
|
+
through logstash:
|
82
|
+
[source,ruby]
|
83
|
+
----
|
84
|
+
input {
|
85
|
+
generator {
|
86
|
+
type => "generated"
|
87
|
+
}
|
88
|
+
}
|
89
|
+
|
90
|
+
filter {
|
91
|
+
if [type] == "generated" {
|
92
|
+
metrics {
|
93
|
+
meter => "events"
|
94
|
+
add_tag => "metric"
|
95
|
+
}
|
96
|
+
}
|
97
|
+
}
|
98
|
+
|
99
|
+
output {
|
100
|
+
# only emit events with the 'metric' tag
|
101
|
+
if "metric" in [tags] {
|
102
|
+
stdout {
|
103
|
+
codec => line {
|
104
|
+
format => "rate: %{[events][rate_1m]}"
|
105
|
+
}
|
106
|
+
}
|
107
|
+
}
|
108
|
+
}
|
109
|
+
----
|
110
|
+
|
111
|
+
Running the above:
|
112
|
+
[source,ruby]
|
113
|
+
% bin/logstash -f example.conf
|
114
|
+
rate: 23721.983566819246
|
115
|
+
rate: 24811.395722536377
|
116
|
+
rate: 25875.892745934525
|
117
|
+
rate: 26836.42375967113
|
118
|
+
|
119
|
+
We see the output includes our events' 1-minute rate.
|
120
|
+
|
121
|
+
In the real world, you would emit this to graphite or another metrics store,
|
122
|
+
like so:
|
123
|
+
[source,ruby]
|
124
|
+
output {
|
125
|
+
graphite {
|
126
|
+
metrics => [ "events.rate_1m", "%{[events][rate_1m]}" ]
|
127
|
+
}
|
128
|
+
}
|
129
|
+
|
130
|
+
[id="plugins-{type}s-{plugin}-options"]
|
131
|
+
==== Metrics Filter Configuration Options
|
132
|
+
|
133
|
+
This plugin supports the following configuration options plus the <<plugins-{type}s-{plugin}-common-options>> described later.
|
134
|
+
|
135
|
+
[cols="<,<,<",options="header",]
|
136
|
+
|=======================================================================
|
137
|
+
|Setting |Input type|Required
|
138
|
+
| <<plugins-{type}s-{plugin}-clear_interval>> |<<number,number>>|No
|
139
|
+
| <<plugins-{type}s-{plugin}-flush_interval>> |<<number,number>>|No
|
140
|
+
| <<plugins-{type}s-{plugin}-ignore_older_than>> |<<number,number>>|No
|
141
|
+
| <<plugins-{type}s-{plugin}-meter>> |<<array,array>>|No
|
142
|
+
| <<plugins-{type}s-{plugin}-percentiles>> |<<array,array>>|No
|
143
|
+
| <<plugins-{type}s-{plugin}-rates>> |<<array,array>>|No
|
144
|
+
| <<plugins-{type}s-{plugin}-timer>> |<<hash,hash>>|No
|
145
|
+
|=======================================================================
|
146
|
+
|
147
|
+
Also see <<plugins-{type}s-{plugin}-common-options>> for a list of options supported by all
|
148
|
+
filter plugins.
|
149
|
+
|
150
|
+
|
151
|
+
|
152
|
+
[id="plugins-{type}s-{plugin}-clear_interval"]
|
153
|
+
===== `clear_interval`
|
154
|
+
|
155
|
+
* Value type is <<number,number>>
|
156
|
+
* Default value is `-1`
|
157
|
+
|
158
|
+
The clear interval, when all counter are reset.
|
159
|
+
|
160
|
+
If set to -1, the default value, the metrics will never be cleared.
|
161
|
+
Otherwise, should be a multiple of 5s.
|
162
|
+
|
163
|
+
[id="plugins-{type}s-{plugin}-flush_interval"]
|
164
|
+
===== `flush_interval`
|
165
|
+
|
166
|
+
* Value type is <<number,number>>
|
167
|
+
* Default value is `5`
|
168
|
+
|
169
|
+
The flush interval, when the metrics event is created. Must be a multiple of 5s.
|
170
|
+
|
171
|
+
[id="plugins-{type}s-{plugin}-ignore_older_than"]
|
172
|
+
===== `ignore_older_than`
|
173
|
+
|
174
|
+
* Value type is <<number,number>>
|
175
|
+
* Default value is `0`
|
176
|
+
|
177
|
+
Don't track events that have `@timestamp` older than some number of seconds.
|
178
|
+
|
179
|
+
This is useful if you want to only include events that are near real-time
|
180
|
+
in your metrics.
|
181
|
+
|
182
|
+
For example, to only count events that are within 10 seconds of real-time, you
|
183
|
+
would do this:
|
184
|
+
|
185
|
+
filter {
|
186
|
+
metrics {
|
187
|
+
meter => [ "hits" ]
|
188
|
+
ignore_older_than => 10
|
189
|
+
}
|
190
|
+
}
|
191
|
+
|
192
|
+
[id="plugins-{type}s-{plugin}-meter"]
|
193
|
+
===== `meter`
|
194
|
+
|
195
|
+
* Value type is <<array,array>>
|
196
|
+
* Default value is `[]`
|
197
|
+
|
198
|
+
syntax: `meter => [ "name of metric", "name of metric" ]`
|
199
|
+
|
200
|
+
[id="plugins-{type}s-{plugin}-percentiles"]
|
201
|
+
===== `percentiles`
|
202
|
+
|
203
|
+
* Value type is <<array,array>>
|
204
|
+
* Default value is `[1, 5, 10, 90, 95, 99, 100]`
|
205
|
+
|
206
|
+
The percentiles that should be measured and emitted for timer values.
|
207
|
+
|
208
|
+
[id="plugins-{type}s-{plugin}-rates"]
|
209
|
+
===== `rates`
|
210
|
+
|
211
|
+
* Value type is <<array,array>>
|
212
|
+
* Default value is `[1, 5, 15]`
|
213
|
+
|
214
|
+
The rates that should be measured, in minutes.
|
215
|
+
Possible values are 1, 5, and 15.
|
216
|
+
|
217
|
+
[id="plugins-{type}s-{plugin}-timer"]
|
218
|
+
===== `timer`
|
219
|
+
|
220
|
+
* Value type is <<hash,hash>>
|
221
|
+
* Default value is `{}`
|
222
|
+
|
223
|
+
syntax: `timer => [ "name of metric", "%{time_value}" ]`
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
[id="plugins-{type}s-{plugin}-common-options"]
|
228
|
+
include::{include_path}/{type}.asciidoc[]
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-metrics'
|
4
|
-
s.version = '4.0.
|
4
|
+
s.version = '4.0.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "The metrics filter is useful for aggregating metrics."
|
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/logstash-plugin install gemname. This gem is not a stand-alone program"
|
@@ -11,7 +11,7 @@ Gem::Specification.new do |s|
|
|
11
11
|
s.require_paths = ["lib"]
|
12
12
|
|
13
13
|
# Files
|
14
|
-
s.files = Dir[
|
14
|
+
s.files = Dir["lib/**/*","spec/**/*","*.gemspec","*.md","CONTRIBUTORS","Gemfile","LICENSE","NOTICE.TXT", "vendor/jar-dependencies/**/*.jar", "vendor/jar-dependencies/**/*.rb", "VERSION", "docs/**/*"]
|
15
15
|
|
16
16
|
# Tests
|
17
17
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-metrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,6 +84,7 @@ files:
|
|
84
84
|
- LICENSE
|
85
85
|
- NOTICE.TXT
|
86
86
|
- README.md
|
87
|
+
- docs/index.asciidoc
|
87
88
|
- lib/logstash/filters/metrics.rb
|
88
89
|
- logstash-filter-metrics.gemspec
|
89
90
|
- spec/filters/metrics_spec.rb
|
@@ -109,7 +110,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
109
110
|
version: '0'
|
110
111
|
requirements: []
|
111
112
|
rubyforge_project:
|
112
|
-
rubygems_version: 2.
|
113
|
+
rubygems_version: 2.4.8
|
113
114
|
signing_key:
|
114
115
|
specification_version: 4
|
115
116
|
summary: The metrics filter is useful for aggregating metrics.
|