logstash-filter-elapsed 2.0.2 → 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 +5 -2
- data/README.md +3 -0
- data/lib/logstash/filters/elapsed.rb +8 -8
- data/logstash-filter-elapsed.gemspec +1 -2
- data/spec/filters/elapsed_spec.rb +17 -17
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fb0e8d4bedc7a363160669b95bc132f77e91977d
|
4
|
+
data.tar.gz: 80d63c4afd29da99bb8abb2f94bc3f245bce210a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71540a7578e7540d6ef0497bfe9dfbfcd3a2ec2f332dfb610756fa9fe60b33ebb42b34bf53fc458208724158ad565d463a83f95d442ee087f7ac0533155f5167
|
7
|
+
data.tar.gz: d5bb32baf65d9b78c05bf4c649019cba5daf0153583830ad343cc76e6f12d00eaa898aa45bb40cce92ac9864a70fcfecaf07538c5ee320f1dbf9d478e7e43211
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
- Elasticsearch 2.0 does not allow field names with dots in them. This is a
|
3
|
+
breaking change which replaces the `.` with an underscore, `_`
|
4
|
+
|
1
5
|
## 2.0.0
|
2
|
-
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
6
|
+
- Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
3
7
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
4
8
|
- Dependency on logstash-core update to 2.0
|
5
|
-
|
data/README.md
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
# Logstash Plugin
|
2
2
|
|
3
|
+
[](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-elapsed-unit/)
|
5
|
+
|
3
6
|
This is a plugin for [Logstash](https://github.com/elastic/logstash).
|
4
7
|
|
5
8
|
It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
|
@@ -65,24 +65,24 @@ require 'socket'
|
|
65
65
|
# "end event" or a new "match event" can be created. Both events store the
|
66
66
|
# following information:
|
67
67
|
#
|
68
|
-
# * the tags `elapsed` and `
|
69
|
-
# * the field `
|
68
|
+
# * the tags `elapsed` and `elapsed_match`
|
69
|
+
# * the field `elapsed_time` with the difference, in seconds, between
|
70
70
|
# the two events timestamps
|
71
71
|
# * an ID filed with the task ID
|
72
|
-
# * the field `
|
72
|
+
# * the field `elapsed_timestamp_start` with the timestamp of the start event
|
73
73
|
#
|
74
74
|
# If the "end event" does not arrive before "timeout" seconds, the
|
75
75
|
# "start event" is discarded and an "expired event" is generated. This event
|
76
76
|
# contains:
|
77
77
|
#
|
78
|
-
# * the tags `elapsed` and `
|
79
|
-
# * a field called `
|
78
|
+
# * the tags `elapsed` and `elapsed_expired_error`
|
79
|
+
# * a field called `elapsed_time` with the age, in seconds, of the
|
80
80
|
# "start event"
|
81
81
|
# * an ID filed with the task ID
|
82
|
-
# * the field `
|
82
|
+
# * the field `elapsed_timestamp_start` with the timestamp of the "start event"
|
83
83
|
#
|
84
84
|
class LogStash::Filters::Elapsed < LogStash::Filters::Base
|
85
|
-
PREFIX = "
|
85
|
+
PREFIX = "elapsed_"
|
86
86
|
ELAPSED_FIELD = PREFIX + "time"
|
87
87
|
TIMESTAMP_START_EVENT_FIELD = PREFIX + "timestamp_start"
|
88
88
|
HOST_FIELD = "host"
|
@@ -131,7 +131,7 @@ class LogStash::Filters::Elapsed < LogStash::Filters::Base
|
|
131
131
|
end
|
132
132
|
|
133
133
|
def filter(event)
|
134
|
-
|
134
|
+
|
135
135
|
|
136
136
|
unique_id = event[@unique_id_field]
|
137
137
|
return if unique_id.nil?
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-elapsed'
|
4
|
-
s.version = '
|
4
|
+
s.version = '3.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "This filter tracks a pair of start/end events and calculates the elapsed time between them."
|
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"
|
@@ -24,4 +24,3 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.add_development_dependency 'logstash-devutils'
|
26
26
|
end
|
27
|
-
|
@@ -100,12 +100,12 @@ describe LogStash::Filters::Elapsed do
|
|
100
100
|
|
101
101
|
describe "and with an id" do
|
102
102
|
describe "but without a previous 'start event'" do
|
103
|
-
it "adds a tag '
|
103
|
+
it "adds a tag 'elapsed_end_witout_start' to the 'end event'" do
|
104
104
|
end_event = end_event(ID_FIELD => "id_123")
|
105
105
|
|
106
106
|
@filter.filter(end_event)
|
107
107
|
|
108
|
-
insist { end_event["tags"].include?("
|
108
|
+
insist { end_event["tags"].include?("elapsed_end_without_start") } == true
|
109
109
|
end
|
110
110
|
end
|
111
111
|
end
|
@@ -153,16 +153,16 @@ describe LogStash::Filters::Elapsed do
|
|
153
153
|
insist { @match_event["tags"].include?("elapsed") } == true
|
154
154
|
end
|
155
155
|
|
156
|
-
it "contains the tag tag '
|
157
|
-
insist { @match_event["tags"].include?("
|
156
|
+
it "contains the tag tag 'elapsed_match'" do
|
157
|
+
insist { @match_event["tags"].include?("elapsed_match") } == true
|
158
158
|
end
|
159
159
|
|
160
|
-
it "contains an '
|
161
|
-
insist { @match_event["
|
160
|
+
it "contains an 'elapsed_time field' with the elapsed time" do
|
161
|
+
insist { @match_event["elapsed_time"] } == 10
|
162
162
|
end
|
163
163
|
|
164
|
-
it "contains an '
|
165
|
-
insist { @match_event["
|
164
|
+
it "contains an 'elapsed_timestamp_start field' with the timestamp of the 'start event'" do
|
165
|
+
insist { @match_event["elapsed_timestamp_start"] } == @start_event["@timestamp"]
|
166
166
|
end
|
167
167
|
|
168
168
|
it "contains an 'id field'" do
|
@@ -263,9 +263,9 @@ describe LogStash::Filters::Elapsed do
|
|
263
263
|
insist { @filter.start_events.key?("3") } == false
|
264
264
|
end
|
265
265
|
|
266
|
-
it "creates a new event with tag '
|
267
|
-
insist { @expired_events[0]["tags"].include?("
|
268
|
-
insist { @expired_events[1]["tags"].include?("
|
266
|
+
it "creates a new event with tag 'elapsed_expired_error' for each expired 'start event'" do
|
267
|
+
insist { @expired_events[0]["tags"].include?("elapsed_expired_error") } == true
|
268
|
+
insist { @expired_events[1]["tags"].include?("elapsed_expired_error") } == true
|
269
269
|
end
|
270
270
|
|
271
271
|
it "creates a new event with tag 'elapsed' for each expired 'start event'" do
|
@@ -278,14 +278,14 @@ describe LogStash::Filters::Elapsed do
|
|
278
278
|
insist { @expired_events[1][ID_FIELD] } == "3"
|
279
279
|
end
|
280
280
|
|
281
|
-
it "creates a new event containing an '
|
282
|
-
insist { @expired_events[0]["
|
283
|
-
insist { @expired_events[1]["
|
281
|
+
it "creates a new event containing an 'elapsed_time field' with the age of the expired 'start event'" do
|
282
|
+
insist { @expired_events[0]["elapsed_time"] } == 30
|
283
|
+
insist { @expired_events[1]["elapsed_time"] } == 31
|
284
284
|
end
|
285
285
|
|
286
|
-
it "creates a new event containing an '
|
287
|
-
insist { @expired_events[0]["
|
288
|
-
insist { @expired_events[1]["
|
286
|
+
it "creates a new event containing an 'elapsed_timestamp_start field' with the timestamp of the expired 'start event'" do
|
287
|
+
insist { @expired_events[0]["elapsed_timestamp_start"] } == @start_event_2["@timestamp"]
|
288
|
+
insist { @expired_events[1]["elapsed_timestamp_start"] } == @start_event_3["@timestamp"]
|
289
289
|
end
|
290
290
|
|
291
291
|
it "creates a new event containing a 'host field' for each expired 'start event'" do
|
metadata
CHANGED
@@ -1,17 +1,18 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-elapsed
|
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
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
|
14
|
+
name: logstash-core
|
15
|
+
version_requirements: !ruby/object:Gem::Requirement
|
15
16
|
requirements:
|
16
17
|
- - '>='
|
17
18
|
- !ruby/object:Gem::Version
|
@@ -19,10 +20,7 @@ dependencies:
|
|
19
20
|
- - <
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 3.0.0
|
22
|
-
|
23
|
-
prerelease: false
|
24
|
-
type: :runtime
|
25
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirement: !ruby/object:Gem::Requirement
|
26
24
|
requirements:
|
27
25
|
- - '>='
|
28
26
|
- !ruby/object:Gem::Version
|
@@ -30,35 +28,37 @@ dependencies:
|
|
30
28
|
- - <
|
31
29
|
- !ruby/object:Gem::Version
|
32
30
|
version: 3.0.0
|
31
|
+
prerelease: false
|
32
|
+
type: :runtime
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
|
-
|
34
|
+
name: logstash-devutils
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
35
36
|
requirements:
|
36
37
|
- - '>='
|
37
38
|
- !ruby/object:Gem::Version
|
38
39
|
version: '0'
|
39
|
-
|
40
|
-
prerelease: false
|
41
|
-
type: :development
|
42
|
-
version_requirements: !ruby/object:Gem::Requirement
|
40
|
+
requirement: !ruby/object:Gem::Requirement
|
43
41
|
requirements:
|
44
42
|
- - '>='
|
45
43
|
- !ruby/object:Gem::Version
|
46
44
|
version: '0'
|
45
|
+
prerelease: false
|
46
|
+
type: :development
|
47
47
|
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
|
48
48
|
email: info@elastic.co
|
49
49
|
executables: []
|
50
50
|
extensions: []
|
51
51
|
extra_rdoc_files: []
|
52
52
|
files:
|
53
|
+
- lib/logstash/filters/elapsed.rb
|
54
|
+
- spec/filters/elapsed_spec.rb
|
55
|
+
- logstash-filter-elapsed.gemspec
|
56
|
+
- README.md
|
53
57
|
- CHANGELOG.md
|
54
58
|
- CONTRIBUTORS
|
55
59
|
- Gemfile
|
56
60
|
- LICENSE
|
57
61
|
- NOTICE.TXT
|
58
|
-
- README.md
|
59
|
-
- lib/logstash/filters/elapsed.rb
|
60
|
-
- logstash-filter-elapsed.gemspec
|
61
|
-
- spec/filters/elapsed_spec.rb
|
62
62
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
63
63
|
licenses:
|
64
64
|
- Apache License (2.0)
|
@@ -81,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
81
|
version: '0'
|
82
82
|
requirements: []
|
83
83
|
rubyforge_project:
|
84
|
-
rubygems_version: 2.
|
84
|
+
rubygems_version: 2.1.9
|
85
85
|
signing_key:
|
86
86
|
specification_version: 4
|
87
87
|
summary: This filter tracks a pair of start/end events and calculates the elapsed time between them.
|