logstash-filter-mutate 3.5.1 → 3.5.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5eff46dce19ce289664364fdb1d47dbb79ce30b62a55646c9210fad216f1f0bb
4
- data.tar.gz: 6e4944bef0a9b9da0ab0cf985148b9866884753f53d14b408b770cf8e97b6ad6
3
+ metadata.gz: 53853b61a143395ded602ed7b065eba14dac85d4135b2135c1c0db541062c6a8
4
+ data.tar.gz: 6a48ec84da666bcc11bef8613f6e8340306c27e39dc4204f2c50cc993c5a2a70
5
5
  SHA512:
6
- metadata.gz: 2b0d285df7cdd66b59173c690e2105af45074a38db77fa7bf564bcb8f827285f5b2547e79f41fc86473b09e9460143a91d23bb42ab637d227a63402a6bbd2cc3
7
- data.tar.gz: 9361cc2a7f9e51c22f0dfe21bf944989dc19b8a31ecfd22e69e5b6907137626a70738d52d32fb9588d8bcdea8d3b55cb8597e3444cc8576bb4093ad79fc736a1
6
+ metadata.gz: f5e4abc14b42d8a8370ed66541c79c27f94a0e26458e70d70c3fb944d4d12f97aeb9d7cb0ad60e6aa2771fe548f473077b9670ab3fdfec4a370654b2624f89ca
7
+ data.tar.gz: cd46fb549dcefc6b00cc51ca19f17ff19dd6ef86a10d26466a637ed1257ba40e93290a12a1afcca129b980286237fee82203c3b009b6df38e7d4b16fdd446995
data/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ ## 3.5.5
2
+ - Fix: removed code and documentation for already removed 'remove' option. [#161](https://github.com/logstash-plugins/logstash-filter-mutate/pull/161)
3
+
4
+ ## 3.5.4
5
+ - DOC: In 'replace' documentation, mention 'add' behavior [#155](https://github.com/logstash-plugins/logstash-filter-mutate/pull/155)
6
+ - DOC: Add warning about #27 [#101](https://github.com/logstash-plugins/logstash-filter-mutate/pull/101)
7
+
8
+ ## 3.5.3
9
+ - DOC: Expand description and behaviors for `rename` option [#156](https://github.com/logstash-plugins/logstash-filter-mutate/pull/156)
10
+
11
+ ## 3.5.2
12
+ - Fix: ensure that when an error occurs during registration, we use the correct i18n key to propagate the error message in a useful manner [#154](https://github.com/logstash-plugins/logstash-filter-mutate/pull/154)
13
+
1
14
  ## 3.5.1
2
15
  - Fix: removed a minor optimization in case-conversion helpers that could result in a race condition in very rare and specific situations [#151](https://github.com/logstash-plugins/logstash-filter-mutate/pull/151)
3
16
 
data/docs/index.asciidoc CHANGED
@@ -21,7 +21,7 @@ include::{include_path}/plugin_header.asciidoc[]
21
21
  ==== Description
22
22
 
23
23
  The mutate filter allows you to perform general mutations on fields. You
24
- can rename, remove, replace, and modify fields in your events.
24
+ can rename, replace, and modify fields in your events.
25
25
 
26
26
  [id="plugins-{type}s-{plugin}-proc_order"]
27
27
  ===== Processing order
@@ -38,13 +38,12 @@ Mutations in a config file are executed in this order:
38
38
  * capitalize
39
39
  * lowercase
40
40
  * strip
41
- * remove
42
41
  * split
43
42
  * join
44
43
  * merge
45
44
  * copy
46
45
 
47
- You can control the order by using separate mutate blocks.
46
+ IMPORTANT: Each mutation must be in its own code block if the sequence of operations needs to be preserved.
48
47
 
49
48
  Example:
50
49
  [source,ruby]
@@ -56,7 +55,7 @@ filter {
56
55
  }
57
56
 
58
57
  mutate {
59
- rename => ["shortHostname", "hostname" ]
58
+ rename => {"shortHostname" => "hostname"}
60
59
  }
61
60
  }
62
61
  -----
@@ -265,6 +264,13 @@ Example:
265
264
 
266
265
  Rename one or more fields.
267
266
 
267
+ If the destination field already exists, its value is replaced.
268
+
269
+ If one of the source fields doesn't exist, no action is performed for that field.
270
+ (This is not considered an error; the `tag_on_failure` tag is not applied.)
271
+
272
+ When renaming multiple fields, the order of operations is not guaranteed.
273
+
268
274
  Example:
269
275
  [source,ruby]
270
276
  filter {
@@ -280,7 +286,8 @@ Example:
280
286
  * Value type is <<hash,hash>>
281
287
  * There is no default value for this setting.
282
288
 
283
- Replace the value of a field with a new value. The new value can include `%{foo}` strings
289
+ Replace the value of a field with a new value, or add the field if it
290
+ doesn't already exist. The new value can include `%{foo}` strings
284
291
  to help you build a new value from other parts of the event.
285
292
 
286
293
  Example:
@@ -3,7 +3,7 @@ require "logstash/filters/base"
3
3
  require "logstash/namespace"
4
4
 
5
5
  # The mutate filter allows you to perform general mutations on fields. You
6
- # can rename, remove, replace, and modify fields in your events.
6
+ # can rename, replace, and modify fields in your events.
7
7
  class LogStash::Filters::Mutate < LogStash::Filters::Base
8
8
  config_name "mutate"
9
9
 
@@ -220,7 +220,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
220
220
  @convert.nil? or @convert.each do |field, type|
221
221
  if !valid_conversions.include?(type)
222
222
  raise LogStash::ConfigurationError, I18n.t(
223
- "logstash.agent.configuration.invalid_plugin_register",
223
+ "logstash.runner.configuration.invalid_plugin_register",
224
224
  :plugin => "filter",
225
225
  :type => "mutate",
226
226
  :error => "Invalid conversion type '#{type}', expected one of '#{valid_conversions.join(',')}'"
@@ -232,7 +232,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
232
232
  @gsub.nil? or @gsub.each_slice(3) do |field, needle, replacement|
233
233
  if [field, needle, replacement].any? {|n| n.nil?}
234
234
  raise LogStash::ConfigurationError, I18n.t(
235
- "logstash.agent.configuration.invalid_plugin_register",
235
+ "logstash.runner.configuration.invalid_plugin_register",
236
236
  :plugin => "filter",
237
237
  :type => "mutate",
238
238
  :error => "Invalid gsub configuration #{[field, needle, replacement]}. gsub requires 3 non-nil elements per config entry"
@@ -258,7 +258,6 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
258
258
  capitalize(event) if @capitalize
259
259
  lowercase(event) if @lowercase
260
260
  strip(event) if @strip
261
- remove(event) if @remove
262
261
  split(event) if @split
263
262
  join(event) if @join
264
263
  merge(event) if @merge
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-mutate'
4
- s.version = '3.5.1'
4
+ s.version = '3.5.5'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Performs mutations on fields"
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"
@@ -321,7 +321,7 @@ describe LogStash::Filters::Mutate do
321
321
  CONFIG
322
322
 
323
323
  sample "not_really_important" do
324
- expect {subject}.to raise_error LogStash::ConfigurationError
324
+ expect {subject}.to raise_error(LogStash::ConfigurationError, /Invalid conversion type/)
325
325
  end
326
326
  end
327
327
  describe "invalid gsub triad should raise a configuration error" do
@@ -334,7 +334,7 @@ describe LogStash::Filters::Mutate do
334
334
  CONFIG
335
335
 
336
336
  sample "not_really_important" do
337
- expect {subject}.to raise_error LogStash::ConfigurationError
337
+ expect {subject}.to raise_error(LogStash::ConfigurationError, /Invalid gsub configuration/)
338
338
  end
339
339
  end
340
340
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-mutate
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.5.1
4
+ version: 3.5.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -126,8 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
126
126
  - !ruby/object:Gem::Version
127
127
  version: '0'
128
128
  requirements: []
129
- rubyforge_project:
130
- rubygems_version: 2.6.13
129
+ rubygems_version: 3.1.6
131
130
  signing_key:
132
131
  specification_version: 4
133
132
  summary: Performs mutations on fields