logstash-filter-prune 2.0.6 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/CONTRIBUTORS +1 -0
- data/lib/logstash/filters/prune.rb +22 -17
- data/logstash-filter-prune.gemspec +2 -2
- data/spec/filters/prune_spec.rb +102 -102
- metadata +12 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ef1690c69edaaf16f57f240c96677c00d86cb95
|
4
|
+
data.tar.gz: 99015b154c7efe6f4d5921041c05ca8ba866718e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03283a46d5f871fccc10fcbb6ce9f57dcf6dca4b4a588dead0297201b75da9525ef33391fd8c4f366e02c88eb6f02f133ebfabf262449238616eb2c0ce2474f0
|
7
|
+
data.tar.gz: 3741c495ba8f040549e38186abf74f98d2d59daa27e931342012a6b0a43727c9b04352a077de2ea6094156c9c4c61763fe171ede89c3adbb7433f2ca31444354
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,7 @@
|
|
1
|
+
## 3.0.0
|
2
|
+
- internal: Bumped up logstash-core-plugin-api dependency to allow installation with Logstash 5.
|
3
|
+
- doc: Clarify that pruning of subfields is unsupported.
|
4
|
+
|
1
5
|
## 2.0.6
|
2
6
|
- doc: Documentation improvements.
|
3
7
|
|
@@ -11,7 +15,7 @@
|
|
11
15
|
- internal,deps: New dependency requirements for logstash-core for the 5.0 release
|
12
16
|
|
13
17
|
## 2.0.0
|
14
|
-
- internal: Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
18
|
+
- internal: Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
|
15
19
|
instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
|
16
20
|
- internal,deps: Dependency on logstash-core update to 2.0
|
17
21
|
|
data/CONTRIBUTORS
CHANGED
@@ -14,19 +14,19 @@ require "logstash/namespace"
|
|
14
14
|
#
|
15
15
|
# Usage help:
|
16
16
|
# To specify a exact field name or value use the regular expression syntax `^some_name_or_value$`.
|
17
|
-
# Example usage: Input data `{ "msg":"hello world", "msg_short":"hw" }`
|
17
|
+
# Example usage: Input data `{ "msg":"hello world", "msg_short":"hw" }`
|
18
18
|
# [source,ruby]
|
19
|
-
# filter {
|
20
|
-
# %PLUGIN% {
|
19
|
+
# filter {
|
20
|
+
# %PLUGIN% {
|
21
21
|
# whitelist_names => [ "msg" ]
|
22
22
|
# }
|
23
23
|
# }
|
24
24
|
# Allows both `"msg"` and `"msg_short"` through.
|
25
|
-
#
|
25
|
+
#
|
26
26
|
# While:
|
27
27
|
# [source,ruby]
|
28
|
-
# filter {
|
29
|
-
# %PLUGIN% {
|
28
|
+
# filter {
|
29
|
+
# %PLUGIN% {
|
30
30
|
# whitelist_names => ["^msg$"]
|
31
31
|
# }
|
32
32
|
# }
|
@@ -34,6 +34,10 @@ require "logstash/namespace"
|
|
34
34
|
#
|
35
35
|
# Logstash stores an event's `tags` as a field which is subject to pruning. Remember to `whitelist_names => [ "^tags$" ]`
|
36
36
|
# to maintain `tags` after pruning or use `blacklist_values => [ "^tag_name$" ]` to eliminate a specific `tag`.
|
37
|
+
#
|
38
|
+
# NOTE: This filter currently only support operations on top-level fields,
|
39
|
+
# i.e. whitelisting and blacklisting of subfields based on name or value
|
40
|
+
# does not work.
|
37
41
|
|
38
42
|
class LogStash::Filters::Prune < LogStash::Filters::Base
|
39
43
|
config_name "prune"
|
@@ -44,9 +48,9 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
44
48
|
config :interpolate, :validate => :boolean, :default => false
|
45
49
|
|
46
50
|
# Include only fields only if their names match specified regexps, default to empty list which means include everything.
|
47
|
-
# [source,ruby]
|
48
|
-
# filter {
|
49
|
-
# %PLUGIN% {
|
51
|
+
# [source,ruby]
|
52
|
+
# filter {
|
53
|
+
# %PLUGIN% {
|
50
54
|
# whitelist_names => [ "method", "(referrer|status)", "${some}_field" ]
|
51
55
|
# }
|
52
56
|
# }
|
@@ -54,8 +58,8 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
54
58
|
|
55
59
|
# Exclude fields whose names match specified regexps, by default exclude unresolved `%{field}` strings.
|
56
60
|
# [source,ruby]
|
57
|
-
# filter {
|
58
|
-
# %PLUGIN% {
|
61
|
+
# filter {
|
62
|
+
# %PLUGIN% {
|
59
63
|
# blacklist_names => [ "method", "(referrer|status)", "${some}_field" ]
|
60
64
|
# }
|
61
65
|
# }
|
@@ -64,8 +68,8 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
64
68
|
# Include specified fields only if their values match one of the supplied regular expressions.
|
65
69
|
# In case field values are arrays, each array item is matched against the regular expressions and only matching array items will be included.
|
66
70
|
# [source,ruby]
|
67
|
-
# filter {
|
68
|
-
# %PLUGIN% {
|
71
|
+
# filter {
|
72
|
+
# %PLUGIN% {
|
69
73
|
# whitelist_values => [ "uripath", "/index.php",
|
70
74
|
# "method", "(GET|POST)",
|
71
75
|
# "status", "^[^2]" ]
|
@@ -76,8 +80,8 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
76
80
|
# Exclude specified fields if their values match one of the supplied regular expressions.
|
77
81
|
# In case field values are arrays, each array item is matched against the regular expressions and matching array items will be excluded.
|
78
82
|
# [source,ruby]
|
79
|
-
# filter {
|
80
|
-
# %PLUGIN% {
|
83
|
+
# filter {
|
84
|
+
# %PLUGIN% {
|
81
85
|
# blacklist_values => [ "uripath", "/index.php",
|
82
86
|
# "method", "(HEAD|OPTIONS)",
|
83
87
|
# "status", "^[^2]" ]
|
@@ -101,7 +105,7 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
101
105
|
|
102
106
|
public
|
103
107
|
def filter(event)
|
104
|
-
|
108
|
+
|
105
109
|
|
106
110
|
hash = event.to_hash
|
107
111
|
|
@@ -161,9 +165,10 @@ class LogStash::Filters::Prune < LogStash::Filters::Base
|
|
161
165
|
|
162
166
|
fields_to_remove.each do |field|
|
163
167
|
if field.is_a?(Hash)
|
164
|
-
|
168
|
+
event.set(field[:key], hash[field[:key]] - field[:values])
|
165
169
|
else
|
166
170
|
hash.delete(field)
|
171
|
+
event.remove(field)
|
167
172
|
end
|
168
173
|
end
|
169
174
|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-prune'
|
4
|
-
s.version = '
|
4
|
+
s.version = '3.0.0'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "The prune filter is for pruning event data from fields based on whitelist/blacklist of field names or their values (names and values can also be regular expressions)"
|
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"
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
|
21
21
|
|
22
22
|
# Gem dependencies
|
23
|
-
s.add_runtime_dependency
|
23
|
+
s.add_runtime_dependency 'logstash-core-plugin-api', '>= 1.60', '<= 2.99'
|
24
24
|
|
25
25
|
s.add_development_dependency 'logstash-devutils'
|
26
26
|
end
|
data/spec/filters/prune_spec.rb
CHANGED
@@ -16,7 +16,7 @@ describe LogStash::Filters::Prune, :if => false do
|
|
16
16
|
prune { }
|
17
17
|
}
|
18
18
|
CONFIG
|
19
|
-
|
19
|
+
|
20
20
|
sample(
|
21
21
|
"firstname" => "Borat",
|
22
22
|
"lastname" => "Sagdiyev",
|
@@ -28,15 +28,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
28
28
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
29
29
|
"%{hmm}" => "doh"
|
30
30
|
) do
|
31
|
-
insist { subject
|
32
|
-
insist { subject
|
33
|
-
insist { subject
|
34
|
-
insist { subject
|
35
|
-
insist { subject
|
36
|
-
insist { subject
|
37
|
-
insist { subject
|
38
|
-
insist { subject
|
39
|
-
insist { subject
|
31
|
+
insist { subject.get("firstname") } == "Borat"
|
32
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
33
|
+
insist { subject.get("fullname") } == "Borat Sagdiyev"
|
34
|
+
insist { subject.get("country") } == "Kazakhstan"
|
35
|
+
insist { subject.get("location") } == "Somethere in Kazakhstan"
|
36
|
+
insist { subject.get("hobby") } == "Cloud"
|
37
|
+
insist { subject.get("status") } == "200"
|
38
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
39
|
+
insist { subject.get("%{hmm}") } == nil
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
@@ -49,7 +49,7 @@ describe LogStash::Filters::Prune, :if => false do
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
CONFIG
|
52
|
-
|
52
|
+
|
53
53
|
sample(
|
54
54
|
"firstname" => "Borat",
|
55
55
|
"lastname" => "Sagdiyev",
|
@@ -61,15 +61,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
61
61
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
62
62
|
"%{hmm}" => "doh"
|
63
63
|
) do
|
64
|
-
insist { subject
|
65
|
-
insist { subject
|
66
|
-
insist { subject
|
67
|
-
insist { subject
|
68
|
-
insist { subject
|
69
|
-
insist { subject
|
70
|
-
insist { subject
|
71
|
-
insist { subject
|
72
|
-
insist { subject
|
64
|
+
insist { subject.get("firstname") } == "Borat"
|
65
|
+
insist { subject.get("lastname") } == nil
|
66
|
+
insist { subject.get("fullname") } == nil
|
67
|
+
insist { subject.get("country") } == nil
|
68
|
+
insist { subject.get("location") } == nil
|
69
|
+
insist { subject.get("hobby") } == "Cloud"
|
70
|
+
insist { subject.get("status") } == "200"
|
71
|
+
insist { subject.get("Borat_saying") } == nil
|
72
|
+
insist { subject.get("%{hmm}") } == nil
|
73
73
|
end
|
74
74
|
end
|
75
75
|
|
@@ -83,7 +83,7 @@ describe LogStash::Filters::Prune, :if => false do
|
|
83
83
|
}
|
84
84
|
}
|
85
85
|
CONFIG
|
86
|
-
|
86
|
+
|
87
87
|
sample(
|
88
88
|
"firstname" => "Borat",
|
89
89
|
"lastname" => "Sagdiyev",
|
@@ -95,15 +95,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
95
95
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
96
96
|
"%{hmm}" => "doh"
|
97
97
|
) do
|
98
|
-
insist { subject
|
99
|
-
insist { subject
|
100
|
-
insist { subject
|
101
|
-
insist { subject
|
102
|
-
insist { subject
|
103
|
-
insist { subject
|
104
|
-
insist { subject
|
105
|
-
insist { subject
|
106
|
-
insist { subject
|
98
|
+
insist { subject.get("firstname") } == "Borat"
|
99
|
+
insist { subject.get("lastname") } == nil
|
100
|
+
insist { subject.get("fullname") } == nil
|
101
|
+
insist { subject.get("country") } == nil
|
102
|
+
insist { subject.get("location") } == nil
|
103
|
+
insist { subject.get("hobby") } == "Cloud"
|
104
|
+
insist { subject.get("status") } == "200"
|
105
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
106
|
+
insist { subject.get("%{hmm}") } == nil
|
107
107
|
end
|
108
108
|
end
|
109
109
|
|
@@ -128,15 +128,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
128
128
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
129
129
|
"%{hmm}" => "doh"
|
130
130
|
) do
|
131
|
-
insist { subject
|
132
|
-
insist { subject
|
133
|
-
insist { subject
|
134
|
-
insist { subject
|
135
|
-
insist { subject
|
136
|
-
insist { subject
|
137
|
-
insist { subject
|
138
|
-
insist { subject
|
139
|
-
insist { subject
|
131
|
+
insist { subject.get("firstname") } == nil
|
132
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
133
|
+
insist { subject.get("fullname") } == "Borat Sagdiyev"
|
134
|
+
insist { subject.get("country") } == "Kazakhstan"
|
135
|
+
insist { subject.get("location") } == "Somethere in Kazakhstan"
|
136
|
+
insist { subject.get("hobby") } == nil
|
137
|
+
insist { subject.get("status") } == nil
|
138
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
139
|
+
insist { subject.get("%{hmm}") } == "doh"
|
140
140
|
end
|
141
141
|
end
|
142
142
|
|
@@ -162,15 +162,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
162
162
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
163
163
|
"%{hmm}" => "doh"
|
164
164
|
) do
|
165
|
-
insist { subject
|
166
|
-
insist { subject
|
167
|
-
insist { subject
|
168
|
-
insist { subject
|
169
|
-
insist { subject
|
170
|
-
insist { subject
|
171
|
-
insist { subject
|
172
|
-
insist { subject
|
173
|
-
insist { subject
|
165
|
+
insist { subject.get("firstname") } == nil
|
166
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
167
|
+
insist { subject.get("fullname") } == "Borat Sagdiyev"
|
168
|
+
insist { subject.get("country") } == "Kazakhstan"
|
169
|
+
insist { subject.get("location") } == "Somethere in Kazakhstan"
|
170
|
+
insist { subject.get("hobby") } == nil
|
171
|
+
insist { subject.get("status") } == nil
|
172
|
+
insist { subject.get("Borat_saying") } == nil
|
173
|
+
insist { subject.get("%{hmm}") } == "doh"
|
174
174
|
end
|
175
175
|
end
|
176
176
|
|
@@ -201,25 +201,25 @@ describe LogStash::Filters::Prune, :if => false do
|
|
201
201
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
202
202
|
"%{hmm}" => "doh"
|
203
203
|
) do
|
204
|
-
insist { subject
|
204
|
+
insist { subject.get("firstname") } == "Borat"
|
205
205
|
|
206
206
|
# TODO(sissel): According to the config above, this should be nil because
|
207
207
|
# it is not in the list of whitelisted fields, but we expect it to be
|
208
208
|
# "Sagdiyev" ? I am confused.
|
209
|
-
insist { subject
|
210
|
-
insist { subject
|
211
|
-
insist { subject
|
212
|
-
insist { subject
|
213
|
-
insist { subject
|
214
|
-
insist { subject
|
215
|
-
insist { subject
|
209
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
210
|
+
insist { subject.get("fullname") } == nil
|
211
|
+
insist { subject.get("country") } == "Kazakhstan"
|
212
|
+
insist { subject.get("location") } == nil
|
213
|
+
insist { subject.get("hobby") } == "Cloud"
|
214
|
+
insist { subject.get("status") } == "200"
|
215
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
216
216
|
|
217
217
|
# TODO(sissel): Contrary to the 'lastname' check, we expect %{hmm} field
|
218
|
-
# to be nil because it is not whitelisted, yes? Contradictory insists
|
218
|
+
# to be nil because it is not whitelisted, yes? Contradictory insists
|
219
219
|
# here. I don't know what the intended behavior is... Seems like
|
220
220
|
# whitelist means 'anything not here' but since this test is written
|
221
221
|
# confusingly, I dont' know how to move forward.
|
222
|
-
insist { subject
|
222
|
+
insist { subject.get("%{hmm}") } == nil
|
223
223
|
end
|
224
224
|
end
|
225
225
|
|
@@ -249,15 +249,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
249
249
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
250
250
|
"%{hmm}" => "doh"
|
251
251
|
) do
|
252
|
-
insist { subject
|
253
|
-
insist { subject
|
254
|
-
insist { subject
|
255
|
-
insist { subject
|
256
|
-
insist { subject
|
257
|
-
insist { subject
|
258
|
-
insist { subject
|
259
|
-
insist { subject
|
260
|
-
insist { subject
|
252
|
+
insist { subject.get("firstname") } == "Borat"
|
253
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
254
|
+
insist { subject.get("fullname") } == "Borat Sagdiyev"
|
255
|
+
insist { subject.get("country") } == "Kazakhstan"
|
256
|
+
insist { subject.get("location") } == nil
|
257
|
+
insist { subject.get("hobby") } == "Cloud"
|
258
|
+
insist { subject.get("status") } == "200"
|
259
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
260
|
+
insist { subject.get("%{hmm}") } == nil
|
261
261
|
end
|
262
262
|
end
|
263
263
|
|
@@ -286,15 +286,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
286
286
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
287
287
|
"%{hmm}" => "doh"
|
288
288
|
) do
|
289
|
-
insist { subject
|
290
|
-
insist { subject
|
291
|
-
insist { subject
|
292
|
-
insist { subject
|
293
|
-
insist { subject
|
294
|
-
insist { subject
|
295
|
-
insist { subject
|
296
|
-
insist { subject
|
297
|
-
insist { subject
|
289
|
+
insist { subject.get("firstname") } == nil
|
290
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
291
|
+
insist { subject.get("fullname") } == "Borat Sagdiyev"
|
292
|
+
insist { subject.get("country") } == "Kazakhstan"
|
293
|
+
insist { subject.get("location") } == "Somethere in Kazakhstan"
|
294
|
+
insist { subject.get("hobby") } == "Cloud"
|
295
|
+
insist { subject.get("status") } == nil
|
296
|
+
insist { subject.get("Borat_saying") } == "Cloud is not ready for enterprise if is not integrate with single server running Active Directory."
|
297
|
+
insist { subject.get("%{hmm}") } == nil
|
298
298
|
end
|
299
299
|
end
|
300
300
|
|
@@ -324,15 +324,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
324
324
|
"Borat_saying" => "Cloud is not ready for enterprise if is not integrate with single server running Active Directory.",
|
325
325
|
"%{hmm}" => "doh"
|
326
326
|
) do
|
327
|
-
insist { subject
|
328
|
-
insist { subject
|
329
|
-
insist { subject
|
330
|
-
insist { subject
|
331
|
-
insist { subject
|
332
|
-
insist { subject
|
333
|
-
insist { subject
|
334
|
-
insist { subject
|
335
|
-
insist { subject
|
327
|
+
insist { subject.get("firstname") } == nil
|
328
|
+
insist { subject.get("lastname") } == "Sagdiyev"
|
329
|
+
insist { subject.get("fullname") } == nil
|
330
|
+
insist { subject.get("country") } == "Kazakhstan"
|
331
|
+
insist { subject.get("location") } == "Somethere in Kazakhstan"
|
332
|
+
insist { subject.get("hobby") } == "Cloud"
|
333
|
+
insist { subject.get("status") } == nil
|
334
|
+
insist { subject.get("Borat_saying") } == nil
|
335
|
+
insist { subject.get("%{hmm}") } == nil
|
336
336
|
end
|
337
337
|
end
|
338
338
|
|
@@ -354,10 +354,10 @@ describe LogStash::Filters::Prune, :if => false do
|
|
354
354
|
"status" => [ "100", "200", "300", "400", "500" ],
|
355
355
|
"error" => [ "This is foolish" , "Need smthing smart too" ]
|
356
356
|
) do
|
357
|
-
insist { subject
|
358
|
-
insist { subject
|
359
|
-
insist { subject
|
360
|
-
insist { subject
|
357
|
+
insist { subject.get("blah") } == "foo"
|
358
|
+
insist { subject.get("error") } == nil
|
359
|
+
insist { subject.get("xxx") } == [ "1 2 3", "3 4 5" ]
|
360
|
+
insist { subject.get("status") } == [ "100", "200", "300" ]
|
361
361
|
end
|
362
362
|
end
|
363
363
|
|
@@ -379,15 +379,15 @@ describe LogStash::Filters::Prune, :if => false do
|
|
379
379
|
"status" => [ "100", "200", "300", "400", "500" ],
|
380
380
|
"error" => [ "This is foolish", "Need smthing smart too" ]
|
381
381
|
) do
|
382
|
-
insist { subject
|
383
|
-
insist { subject
|
384
|
-
insist { subject
|
385
|
-
insist { subject
|
382
|
+
insist { subject.get("blah") } == "foo"
|
383
|
+
insist { subject.get("error") } == [ "This is foolish", "Need smthing smart too" ]
|
384
|
+
insist { subject.get("xxx") } == nil
|
385
|
+
insist { subject.get("status") } == [ "400", "500" ]
|
386
386
|
end
|
387
387
|
end
|
388
388
|
|
389
389
|
describe "whitelist field values with interpolation on fields witn array values" do
|
390
|
-
|
390
|
+
|
391
391
|
config <<-CONFIG
|
392
392
|
filter {
|
393
393
|
prune {
|
@@ -405,10 +405,10 @@ describe LogStash::Filters::Prune, :if => false do
|
|
405
405
|
"status" => [ "100", "200", "300", "400", "500" ],
|
406
406
|
"error" => [ "This is foolish" , "Need smthing smart too" ]
|
407
407
|
) do
|
408
|
-
insist { subject
|
409
|
-
insist { subject
|
410
|
-
insist { subject
|
411
|
-
insist { subject
|
408
|
+
insist { subject.get("blah") } == "foo"
|
409
|
+
insist { subject.get("error") } == [ "This is foolish" ]
|
410
|
+
insist { subject.get("xxx") } == [ "1 2 3", "3 4 5" ]
|
411
|
+
insist { subject.get("status") } == [ "100", "200", "300" ]
|
412
412
|
end
|
413
413
|
end
|
414
414
|
|
@@ -431,10 +431,10 @@ describe LogStash::Filters::Prune, :if => false do
|
|
431
431
|
"status" => [ "100", "200", "300", "400", "500" ],
|
432
432
|
"error" => [ "This is foolish" , "Need smthing smart too" ]
|
433
433
|
) do
|
434
|
-
insist { subject
|
435
|
-
insist { subject
|
436
|
-
insist { subject
|
437
|
-
insist { subject
|
434
|
+
insist { subject.get("blah") } == "foo"
|
435
|
+
insist { subject.get("error") } == [ "Need smthing smart too" ]
|
436
|
+
insist { subject.get("xxx") } == nil
|
437
|
+
insist { subject.get("status") } == [ "400", "500" ]
|
438
438
|
end
|
439
439
|
end
|
440
440
|
|
metadata
CHANGED
@@ -1,29 +1,35 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-prune
|
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:
|
11
|
+
date: 2017-01-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
15
15
|
requirements:
|
16
|
-
- - "
|
16
|
+
- - ">="
|
17
|
+
- !ruby/object:Gem::Version
|
18
|
+
version: '1.60'
|
19
|
+
- - "<="
|
17
20
|
- !ruby/object:Gem::Version
|
18
|
-
version: '
|
21
|
+
version: '2.99'
|
19
22
|
name: logstash-core-plugin-api
|
20
23
|
prerelease: false
|
21
24
|
type: :runtime
|
22
25
|
version_requirements: !ruby/object:Gem::Requirement
|
23
26
|
requirements:
|
24
|
-
- - "
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.60'
|
30
|
+
- - "<="
|
25
31
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
32
|
+
version: '2.99'
|
27
33
|
- !ruby/object:Gem::Dependency
|
28
34
|
requirement: !ruby/object:Gem::Requirement
|
29
35
|
requirements:
|