logstash-filter-mutate 3.1.2 → 3.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/logstash/filters/mutate.rb +2 -0
- data/logstash-filter-mutate.gemspec +1 -1
- data/spec/filters/mutate_spec.rb +14 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a56a7078074ef2704ec10834c3e7fe7a664ee647
|
4
|
+
data.tar.gz: 726266e6349d2ecbb8570932c19260a029d0b321
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c034a0c3708ed37330f6fd18746f6fe47a1f0524417e78483c1f56b6115469b0d37da39621c8b67be9ecc187f6c0a9b30fd3f8f37f181b62ec7573ef5f66af5e
|
7
|
+
data.tar.gz: b9f614d74196e90d942b87f376c8f64d4127d544126331b17b20f105bc30b61e1e9545a3d87ce093cad416b8272ab397d29e2bebb67227aa310e544ba82f9f51
|
data/CHANGELOG.md
CHANGED
@@ -324,6 +324,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
|
|
324
324
|
def uppercase(event)
|
325
325
|
@uppercase.each do |field|
|
326
326
|
original = event.get(field)
|
327
|
+
next if original.nil?
|
327
328
|
# in certain cases JRuby returns a proxy wrapper of the event[field] value
|
328
329
|
# therefore we can't assume that we are modifying the actual value behind
|
329
330
|
# the key so read, modify and overwrite
|
@@ -349,6 +350,7 @@ class LogStash::Filters::Mutate < LogStash::Filters::Base
|
|
349
350
|
#see comments for #uppercase
|
350
351
|
@lowercase.each do |field|
|
351
352
|
original = event.get(field)
|
353
|
+
next if original.nil?
|
352
354
|
result = case original
|
353
355
|
when Array
|
354
356
|
original.map! do |elem|
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'logstash-filter-mutate'
|
4
|
-
s.version = '3.1.
|
4
|
+
s.version = '3.1.3'
|
5
5
|
s.licenses = ['Apache License (2.0)']
|
6
6
|
s.summary = "The mutate filter allows you to perform general mutations on fields. You can rename, remove, replace, and modify fields in your events."
|
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"
|
data/spec/filters/mutate_spec.rb
CHANGED
@@ -72,6 +72,20 @@ describe LogStash::Filters::Mutate do
|
|
72
72
|
end
|
73
73
|
end
|
74
74
|
|
75
|
+
%w(lowercase uppercase).each do |operation|
|
76
|
+
context "executing #{operation} a non-existant field" do
|
77
|
+
let(:attrs) { }
|
78
|
+
|
79
|
+
let(:config) do
|
80
|
+
{ operation => ["fake_field"] }
|
81
|
+
end
|
82
|
+
|
83
|
+
it "should not create that field" do
|
84
|
+
subject.filter(event)
|
85
|
+
expect(event).not_to include("fake_field")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
75
89
|
end
|
76
90
|
|
77
91
|
describe LogStash::Filters::Mutate do
|
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.1.
|
4
|
+
version: 3.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Elastic
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-09-
|
11
|
+
date: 2016-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|