logstash-filter-split 2.0.2 → 2.0.4

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
  SHA1:
3
- metadata.gz: b6e4df791ca766dc357fd77db77d23bfeca7ce26
4
- data.tar.gz: 9a23ce2c357a377cc4ed92d15da40c8def8226d2
3
+ metadata.gz: ba35e2ceaacd6c51d8efbfb32c75bd3ac16351cb
4
+ data.tar.gz: 2cae510c32b811abf7ce6d656a93a75e6bebcc06
5
5
  SHA512:
6
- metadata.gz: da44bdc0cb6d211ba8592b383d0c98bea44e7c325673093f9e2fe4aecd00628dcda5776aed106ba987eee3482506cd5254e2cb05dbce739620091979b7b7acae
7
- data.tar.gz: f0ef4e850b4fd66fded71df4aa261899514c73c74d5a266754c777e5c9c022300bb74148df1a3afdeee98c6ec599711f2011a6c0b2847412d40dba808a50a90f
6
+ metadata.gz: 5b6b9fa17e6f7296664b0aecc019f9f3b9812eea5322001ab638c1d371420ece272d831c381272ae39564a50103522b1340c64089d54fef2d0ba197fadc1b2b8
7
+ data.tar.gz: 1f49e45816648aebdb8359cf341cf788f656e2e249c6669ba8558205949ab5fa24df864781902546907d914e92e8b7c135f98820cd3780959722816202ecd18d
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 2.0.4
2
+ - Depend on logstash-core-plugin-api instead of logstash-core, removing the need to mass update plugins on major releases of logstash
3
+ # 2.0.3
4
+ - New dependency requirements for logstash-core for the 5.0 release
1
5
  ## 2.0.0
2
6
  - Plugins were updated to follow the new shutdown semantic, this mainly allows Logstash to instruct input plugins to terminate gracefully,
3
7
  instead of using Thread.raise on the plugins' threads. Ref: https://github.com/elastic/logstash/pull/3895
data/README.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # Logstash Plugin
2
2
 
3
+ [![Build
4
+ Status](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-split-unit/badge/icon)](http://build-eu-00.elastic.co/view/LS%20Plugins/view/LS%20Filters/job/logstash-plugin-filter-split-unit/)
5
+
3
6
  This is a plugin for [Logstash](https://github.com/elastic/logstash).
4
7
 
5
8
  It is fully free and fully open source. The license is Apache 2.0, meaning you are pretty much free to use it however you want in whatever way.
@@ -2,11 +2,14 @@
2
2
  require "logstash/filters/base"
3
3
  require "logstash/namespace"
4
4
 
5
- # The split filter is for splitting multiline messages into separate events.
5
+ # The split filter clones an event by splitting one of its fields and
6
+ # placing each value resulting from the split into a clone of the original
7
+ # event. The field being split can either be a string or an array.
6
8
  #
7
- # An example use case of this filter is for taking output from the `exec` input
8
- # which emits one event for the whole output of a command and splitting that
9
- # output by newline - making each line an event.
9
+ # An example use case of this filter is for taking output from the
10
+ # <<plugins-inputs-exec,exec input plugin>> which emits one event for
11
+ # the whole output of a command and splitting that output by newline -
12
+ # making each line an event.
10
13
  #
11
14
  # The end result of each split is a complete copy of the event
12
15
  # with only the current split section of the given field changed.
@@ -18,11 +21,11 @@ class LogStash::Filters::Split < LogStash::Filters::Base
18
21
  # string.
19
22
  config :terminator, :validate => :string, :default => "\n"
20
23
 
21
- # The field which value is split by the terminator
24
+ # The field whose value is to be split by the terminator.
22
25
  config :field, :validate => :string, :default => "message"
23
26
 
24
27
  # The field within the new event which the value is split into.
25
- # If not set, target field defaults to split field name.
28
+ # If not set, the target field defaults to split field name.
26
29
  config :target, :validate => :string
27
30
 
28
31
  public
@@ -47,7 +50,7 @@ class LogStash::Filters::Split < LogStash::Filters::Base
47
50
  end
48
51
 
49
52
  # Skip filtering if splitting this event resulted in only one thing found.
50
- return if splits.length == 1
53
+ return if splits.length == 1 && original_value.is_a?(String)
51
54
  #or splits[1].empty?
52
55
 
53
56
  splits.each do |value|
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-split'
4
- s.version = '2.0.2'
4
+ s.version = '2.0.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "The split filter is for splitting multiline messages into separate 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/plugin install gemname. This gem is not a stand-alone program"
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
20
20
  s.metadata = { "logstash_plugin" => "true", "logstash_group" => "filter" }
21
21
 
22
22
  # Gem dependencies
23
- s.add_runtime_dependency "logstash-core", ">= 2.0.0.beta2", "< 3.0.0"
23
+ s.add_runtime_dependency "logstash-core-plugin-api", "~> 1.0"
24
24
 
25
25
  s.add_development_dependency 'logstash-devutils'
26
26
  end
@@ -75,6 +75,11 @@ describe LogStash::Filters::Split do
75
75
  insist { subject[1]["array"] } == "bird"
76
76
  insist { subject[2]["array"] } == "sesame street"
77
77
  end
78
+
79
+ sample("array" => ["big"], "untouched" => "1\n2\n3") do
80
+ insist { subject.is_a?(Logstash::Event) }
81
+ insist { subject["array"] } == "big"
82
+ end
78
83
  end
79
84
 
80
85
  describe "split array into new field" do
metadata CHANGED
@@ -1,39 +1,33 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-split
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-14 00:00:00.000000000 Z
11
+ date: 2016-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - '>='
16
+ - - "~>"
17
17
  - !ruby/object:Gem::Version
18
- version: 2.0.0.beta2
19
- - - <
20
- - !ruby/object:Gem::Version
21
- version: 3.0.0
22
- name: logstash-core
18
+ version: '1.0'
19
+ name: logstash-core-plugin-api
23
20
  prerelease: false
24
21
  type: :runtime
25
22
  version_requirements: !ruby/object:Gem::Requirement
26
23
  requirements:
27
- - - '>='
28
- - !ruby/object:Gem::Version
29
- version: 2.0.0.beta2
30
- - - <
24
+ - - "~>"
31
25
  - !ruby/object:Gem::Version
32
- version: 3.0.0
26
+ version: '1.0'
33
27
  - !ruby/object:Gem::Dependency
34
28
  requirement: !ruby/object:Gem::Requirement
35
29
  requirements:
36
- - - '>='
30
+ - - ">="
37
31
  - !ruby/object:Gem::Version
38
32
  version: '0'
39
33
  name: logstash-devutils
@@ -41,7 +35,7 @@ dependencies:
41
35
  type: :development
42
36
  version_requirements: !ruby/object:Gem::Requirement
43
37
  requirements:
44
- - - '>='
38
+ - - ">="
45
39
  - !ruby/object:Gem::Version
46
40
  version: '0'
47
41
  description: This gem is a logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/plugin install gemname. This gem is not a stand-alone program
@@ -71,12 +65,12 @@ require_paths:
71
65
  - lib
72
66
  required_ruby_version: !ruby/object:Gem::Requirement
73
67
  requirements:
74
- - - '>='
68
+ - - ">="
75
69
  - !ruby/object:Gem::Version
76
70
  version: '0'
77
71
  required_rubygems_version: !ruby/object:Gem::Requirement
78
72
  requirements:
79
- - - '>='
73
+ - - ">="
80
74
  - !ruby/object:Gem::Version
81
75
  version: '0'
82
76
  requirements: []