logstash-filter-combine 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 74854f535d2cff3da5922968879b506cd422079b1a954847fa17d3de2e0c7e27
4
- data.tar.gz: 060c9733adbd9976c04fe233b6ee392287a362cbc51e61fd56f1ce58d1a88076
3
+ metadata.gz: 7681235455fa16d69461fa4b481deb623b8d8c3483a2ad3364e1e3477a62518d
4
+ data.tar.gz: 69298e5781ceeb5f390562ebd50d0c5fb0b625f3b06df5490e618c79f9c96139
5
5
  SHA512:
6
- metadata.gz: c9a7f8e010731c9b37f408df373364c0192d83e3f220945678e854a0099521d434630358bb686013eb06bd65967368011096bd0b42b31fc1454440b814bc5f2b
7
- data.tar.gz: 83733bb0957c3d954437cb152cf1c8b74cb7055681465365631921634b48bd09159e7b414ea9f8613712442e1a8484a5c466bab156da727cdcdeac234e6a665b
6
+ metadata.gz: 91a4016735cab4b08d2705d7e273d4250ff030756776f65416e073dc3e701ff7c3f74b3d8ab6e5190f961ceb88290bff3719e0928ca1af3ff7aa6b3c6edf2c08
7
+ data.tar.gz: 98be41b1db98900dc70493e9c1070d1645be1e97007da2bc1867285a4ec82658fd307c9202698a391ef492644687f5ff69c15a337210727e56f172fc89e5b89d
@@ -23,6 +23,7 @@ class LogStash::Filters::Combine < LogStash::Filters::Base
23
23
  config :sources, :validate => :array
24
24
  config :target, :validate => :string
25
25
  config :remove_sources, :validate => :boolean, :default => false
26
+ config :keep_target, :validate => :boolean, :default => false
26
27
 
27
28
  public
28
29
  def register
@@ -31,8 +32,9 @@ class LogStash::Filters::Combine < LogStash::Filters::Base
31
32
 
32
33
  public
33
34
  def filter(event)
34
-
35
- arr = []
35
+
36
+ arr = event.get(@target) if @keep_target
37
+ arr = [] if arr.nil?
36
38
 
37
39
  @sources.each do |field|
38
40
  data = event.get(field)
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-filter-combine'
3
- s.version = '0.1.0'
3
+ s.version = '0.1.1'
4
4
  s.licenses = ['MIT']
5
5
  s.summary = 'Logstash Filter Plugin to combine fields into an array'
6
6
  s.description = 'A logstash filter for combining multiple source fields into a target array.'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-combine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Julian Wecke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-13 00:00:00.000000000 Z
11
+ date: 2024-07-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstash-core-plugin-api