logstash-filter-translate 3.1.0 → 3.2.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 +8 -0
- data/docs/index.asciidoc +173 -33
- data/lib/logstash/filters/array_of_maps_value_update.rb +44 -0
- data/lib/logstash/filters/array_of_values_update.rb +37 -0
- data/lib/logstash/filters/dictionary/csv_file.rb +25 -0
- data/lib/logstash/filters/dictionary/file.rb +140 -0
- data/lib/logstash/filters/dictionary/json_file.rb +87 -0
- data/lib/logstash/filters/dictionary/memory.rb +31 -0
- data/lib/logstash/filters/dictionary/yaml_file.rb +24 -0
- data/lib/logstash/filters/dictionary/yaml_visitor.rb +42 -0
- data/lib/logstash/filters/fetch_strategy/file.rb +81 -0
- data/lib/logstash/filters/fetch_strategy/memory.rb +52 -0
- data/lib/logstash/filters/single_value_update.rb +33 -0
- data/lib/logstash/filters/translate.rb +54 -155
- data/logstash-filter-translate.gemspec +5 -1
- data/spec/filters/benchmark_rspec.rb +69 -0
- data/spec/filters/scheduling_spec.rb +200 -0
- data/spec/filters/translate_spec.rb +238 -45
- data/spec/filters/yaml_visitor_spec.rb +16 -0
- data/spec/fixtures/regex_dict.csv +4 -0
- data/spec/fixtures/regex_union_dict.csv +4 -0
- data/spec/fixtures/tag-map-dict.yml +21 -0
- data/spec/fixtures/tag-omap-dict.yml +21 -0
- data/spec/support/build_huge_dictionaries.rb +33 -0
- data/spec/support/rspec_wait_handler_helper.rb +38 -0
- metadata +87 -2
@@ -0,0 +1,38 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
module RSpec
|
4
|
+
module Wait
|
5
|
+
module Handler
|
6
|
+
def handle_matcher(target, *args, &block)
|
7
|
+
# there is a similar patch in the rspec-wait repo since Nov, 19 2017
|
8
|
+
# it does not look like the author is interested in the change.
|
9
|
+
# - do not use Ruby Timeout
|
10
|
+
count = RSpec.configuration.wait_timeout.fdiv(RSpec.configuration.wait_delay).ceil
|
11
|
+
failure = nil
|
12
|
+
count.times do
|
13
|
+
begin
|
14
|
+
actual = target.respond_to?(:call) ? target.call : target
|
15
|
+
super(actual, *args, &block)
|
16
|
+
failure = nil
|
17
|
+
rescue RSpec::Expectations::ExpectationNotMetError => failure
|
18
|
+
sleep RSpec.configuration.wait_delay
|
19
|
+
end
|
20
|
+
break if failure.nil?
|
21
|
+
end
|
22
|
+
raise failure unless failure.nil?
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
# From: https://github.com/rspec/rspec-expectations/blob/v3.0.0/lib/rspec/expectations/handler.rb#L44-L63
|
27
|
+
class PositiveHandler < RSpec::Expectations::PositiveExpectationHandler
|
28
|
+
extend Handler
|
29
|
+
end
|
30
|
+
|
31
|
+
# From: https://github.com/rspec/rspec-expectations/blob/v3.0.0/lib/rspec/expectations/handler.rb#L66-L93
|
32
|
+
class NegativeHandler < RSpec::Expectations::NegativeExpectationHandler
|
33
|
+
extend Handler
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
RSPEC_WAIT_HANDLER_PATCHED = true
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-translate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-08-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -30,6 +30,20 @@ dependencies:
|
|
30
30
|
- - "<="
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '2.99'
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
requirements:
|
36
|
+
- - ">="
|
37
|
+
- !ruby/object:Gem::Version
|
38
|
+
version: '0'
|
39
|
+
name: rufus-scheduler
|
40
|
+
prerelease: false
|
41
|
+
type: :runtime
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
43
|
+
requirements:
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: '0'
|
33
47
|
- !ruby/object:Gem::Dependency
|
34
48
|
requirement: !ruby/object:Gem::Requirement
|
35
49
|
requirements:
|
@@ -44,6 +58,48 @@ dependencies:
|
|
44
58
|
- - ">="
|
45
59
|
- !ruby/object:Gem::Version
|
46
60
|
version: '0'
|
61
|
+
- !ruby/object:Gem::Dependency
|
62
|
+
requirement: !ruby/object:Gem::Requirement
|
63
|
+
requirements:
|
64
|
+
- - ">="
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
name: rspec-sequencing
|
68
|
+
prerelease: false
|
69
|
+
type: :development
|
70
|
+
version_requirements: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: '0'
|
75
|
+
- !ruby/object:Gem::Dependency
|
76
|
+
requirement: !ruby/object:Gem::Requirement
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: '0'
|
81
|
+
name: rspec-wait
|
82
|
+
prerelease: false
|
83
|
+
type: :development
|
84
|
+
version_requirements: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
- !ruby/object:Gem::Dependency
|
90
|
+
requirement: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
95
|
+
name: benchmark-ips
|
96
|
+
prerelease: false
|
97
|
+
type: :development
|
98
|
+
version_requirements: !ruby/object:Gem::Requirement
|
99
|
+
requirements:
|
100
|
+
- - ">="
|
101
|
+
- !ruby/object:Gem::Version
|
102
|
+
version: '0'
|
47
103
|
description: This gem is a Logstash plugin required to be installed on top of the
|
48
104
|
Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This
|
49
105
|
gem is not a stand-alone program
|
@@ -59,14 +115,34 @@ files:
|
|
59
115
|
- NOTICE.TXT
|
60
116
|
- README.md
|
61
117
|
- docs/index.asciidoc
|
118
|
+
- lib/logstash/filters/array_of_maps_value_update.rb
|
119
|
+
- lib/logstash/filters/array_of_values_update.rb
|
120
|
+
- lib/logstash/filters/dictionary/csv_file.rb
|
121
|
+
- lib/logstash/filters/dictionary/file.rb
|
122
|
+
- lib/logstash/filters/dictionary/json_file.rb
|
123
|
+
- lib/logstash/filters/dictionary/memory.rb
|
124
|
+
- lib/logstash/filters/dictionary/yaml_file.rb
|
125
|
+
- lib/logstash/filters/dictionary/yaml_visitor.rb
|
126
|
+
- lib/logstash/filters/fetch_strategy/file.rb
|
127
|
+
- lib/logstash/filters/fetch_strategy/memory.rb
|
128
|
+
- lib/logstash/filters/single_value_update.rb
|
62
129
|
- lib/logstash/filters/translate.rb
|
63
130
|
- logstash-filter-translate.gemspec
|
131
|
+
- spec/filters/benchmark_rspec.rb
|
132
|
+
- spec/filters/scheduling_spec.rb
|
64
133
|
- spec/filters/translate_spec.rb
|
134
|
+
- spec/filters/yaml_visitor_spec.rb
|
65
135
|
- spec/fixtures/dict-wrong.yml
|
66
136
|
- spec/fixtures/dict.csv
|
67
137
|
- spec/fixtures/dict.json
|
68
138
|
- spec/fixtures/dict.other
|
69
139
|
- spec/fixtures/dict.yml
|
140
|
+
- spec/fixtures/regex_dict.csv
|
141
|
+
- spec/fixtures/regex_union_dict.csv
|
142
|
+
- spec/fixtures/tag-map-dict.yml
|
143
|
+
- spec/fixtures/tag-omap-dict.yml
|
144
|
+
- spec/support/build_huge_dictionaries.rb
|
145
|
+
- spec/support/rspec_wait_handler_helper.rb
|
70
146
|
homepage: http://www.elastic.co/guide/en/logstash/current/index.html
|
71
147
|
licenses:
|
72
148
|
- Apache License (2.0)
|
@@ -94,9 +170,18 @@ signing_key:
|
|
94
170
|
specification_version: 4
|
95
171
|
summary: Replaces field contents based on a hash or YAML file
|
96
172
|
test_files:
|
173
|
+
- spec/filters/benchmark_rspec.rb
|
174
|
+
- spec/filters/scheduling_spec.rb
|
97
175
|
- spec/filters/translate_spec.rb
|
176
|
+
- spec/filters/yaml_visitor_spec.rb
|
98
177
|
- spec/fixtures/dict-wrong.yml
|
99
178
|
- spec/fixtures/dict.csv
|
100
179
|
- spec/fixtures/dict.json
|
101
180
|
- spec/fixtures/dict.other
|
102
181
|
- spec/fixtures/dict.yml
|
182
|
+
- spec/fixtures/regex_dict.csv
|
183
|
+
- spec/fixtures/regex_union_dict.csv
|
184
|
+
- spec/fixtures/tag-map-dict.yml
|
185
|
+
- spec/fixtures/tag-omap-dict.yml
|
186
|
+
- spec/support/build_huge_dictionaries.rb
|
187
|
+
- spec/support/rspec_wait_handler_helper.rb
|