logstash-filter-hash_select 0.1.1 → 0.1.2
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/hash_select.rb +9 -8
- data/logstash-filter-hash_select.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: be7d2e025b4360591b5da998367530c00548077aa57bed363ac925c9dfb80371
|
4
|
+
data.tar.gz: a2b7e07c6c5cbb0f67ced22c3650b7bc24546a0f8448e99aca27a5d7569f21bb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0081bf485da8330d5ea5bea04d5fca50ffc065489f54e11a71661b2bf41041da1adc00eefa8f1663f2d3decda58664ea86cc4f46c26ee26a2a03c4c9d1b1cf32'
|
7
|
+
data.tar.gz: e5f4969df9f6e220999874e9dd452f1c0e9e5b41853d0c13e7f47eb578b559792a78f2adb7e0578dcbd24aaf4d22ca20f366def8aaee7a85921808e1accc8eb9
|
data/CHANGELOG.md
CHANGED
@@ -20,14 +20,15 @@ class LogStash::Filters::Hash_select < LogStash::Filters::Base
|
|
20
20
|
public
|
21
21
|
def filter(event)
|
22
22
|
field = event.get(@hash_field)
|
23
|
-
if field.is_a?(Hash)
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
23
|
+
if field.is_a?(Hash) && (before = field.size).positive?
|
24
|
+
field =
|
25
|
+
if @include_keys.empty?
|
26
|
+
field.reject { |k, _| @exclude_keys.include?(k) } unless @exclude_keys.empty?
|
27
|
+
elsif @exclude_keys.empty?
|
28
|
+
field.select { |k, _| @include_keys.include?(k) }
|
29
|
+
else
|
30
|
+
field.select { |k, _| @include_keys.include?(k) && !@exclude_keys.include?(k) }
|
31
|
+
end
|
31
32
|
event.set(@hash_field, field) if field.size < before
|
32
33
|
end
|
33
34
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'logstash-filter-hash_select'
|
3
|
-
s.version = '0.1.
|
3
|
+
s.version = '0.1.2'
|
4
4
|
s.licenses = ['Apache-2.0']
|
5
5
|
s.summary = 'Select entries from a specific hash field'
|
6
6
|
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'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logstash-filter-hash_select
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Issey Yamakoshi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-11-
|
11
|
+
date: 2023-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: logstash-core-plugin-api
|