logstash-filter-translate 3.3.0 → 3.3.1
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 -0
- data/lib/logstash/filters/dictionary/csv_file.rb +2 -12
- data/logstash-filter-translate.gemspec +1 -1
- data/spec/filters/scheduling_spec.rb +6 -2
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 77bd945dee5e20dbc7eb6837c655e807373ee8923dcbd498c9fcf5b1065c6661
|
4
|
+
data.tar.gz: 878df6d8dfcc5fa53bb617163b0ddfe6feeb8e876aed9668b337f66dc8472221
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d45ec30865d73884f9564f3680fdc1fb230c9fa71507c86d475e6ec0759d13863080f8c237ab34b38ccad08bca0781ab1d8a8523955841db2d0a0334091a9cf3
|
7
|
+
data.tar.gz: 443284f8db270ec6081a2017bd6597733be886643232d97a7630c99e1b194970183e0a7d070ed511bdb1d8069e7f929a991d608798a35d8bd5408878806945d5
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
## 3.3.1
|
2
|
+
- Refactor: reading .csv for JRuby 9.3 compatibility [#94](https://github.com/logstash-plugins/logstash-filter-translate/pull/94)
|
3
|
+
|
4
|
+
NOTE: these changes are essential for the plugin to work properly under Logstash 8.3 and later.
|
5
|
+
|
1
6
|
## 3.3.0
|
2
7
|
- Feat: added ECS compatibility mode [#89](https://github.com/logstash-plugins/logstash-filter-translate/pull/89)
|
3
8
|
- deprecated `destination` option in favor of `target` to better align with other plugins
|
@@ -6,19 +6,9 @@ module LogStash module Filters module Dictionary
|
|
6
6
|
|
7
7
|
protected
|
8
8
|
|
9
|
-
def initialize_for_file_type
|
10
|
-
@io = StringIO.new("")
|
11
|
-
@csv = ::CSV.new(@io)
|
12
|
-
end
|
13
|
-
|
14
9
|
def read_file_into_dictionary
|
15
|
-
|
16
|
-
|
17
|
-
# this overwrites the value at key
|
18
|
-
IO.foreach(@dictionary_path, :mode => 'r:bom|utf-8') do |line|
|
19
|
-
@io.string = line
|
20
|
-
k,v = @csv.shift
|
21
|
-
@dictionary[k] = v
|
10
|
+
::CSV.open(@dictionary_path, 'r:bom|utf-8') do |csv|
|
11
|
+
csv.each { |k,v| @dictionary[k] = v }
|
22
12
|
end
|
23
13
|
end
|
24
14
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-translate'
|
4
|
-
s.version = '3.3.
|
4
|
+
s.version = '3.3.1'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "Replaces field contents based on a hash or YAML file"
|
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"
|
@@ -58,7 +58,9 @@ describe LogStash::Filters::Translate do
|
|
58
58
|
end
|
59
59
|
.then_after(1.2, "wait then translate again") do
|
60
60
|
subject.filter(event)
|
61
|
-
|
61
|
+
try(5) do
|
62
|
+
wait(0.1).for{event.get("[translation]")}.to eq("12"), "field [translation] did not eq '12'"
|
63
|
+
end
|
62
64
|
end
|
63
65
|
.then("stop") do
|
64
66
|
subject.close
|
@@ -87,7 +89,9 @@ describe LogStash::Filters::Translate do
|
|
87
89
|
end
|
88
90
|
.then_after(1.2, "wait then translate again") do
|
89
91
|
subject.filter(event)
|
90
|
-
|
92
|
+
try(5) do
|
93
|
+
wait(0.1).for{event.get("[translation]")}.to eq("22"), "field [translation] did not eq '22'"
|
94
|
+
end
|
91
95
|
end
|
92
96
|
.then("stop") do
|
93
97
|
subject.close
|
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.3.
|
4
|
+
version: 3.3.1
|
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: 2022-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,8 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
206
206
|
- !ruby/object:Gem::Version
|
207
207
|
version: '0'
|
208
208
|
requirements: []
|
209
|
-
|
210
|
-
rubygems_version: 2.6.13
|
209
|
+
rubygems_version: 3.1.6
|
211
210
|
signing_key:
|
212
211
|
specification_version: 4
|
213
212
|
summary: Replaces field contents based on a hash or YAML file
|