logstash-filter-ruby 3.1.3 → 3.1.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
  SHA256:
3
- metadata.gz: 2ae5b9cbafb94344c6850c0fac54655902206b92a4f71b86970b3d0c09b895b1
4
- data.tar.gz: f1eb4fdada816333e22d8361c6f87d73ebdbeb5408e45c8eafc144d58ebc8e72
3
+ metadata.gz: 271561a7f499fd9c88f66ab5e9996632fedad8b754f9736f8822733e5826c458
4
+ data.tar.gz: b91749139896908ae0fd1d8dd7532a4edb2103828aaf2dba1e0756ae85a0ed56
5
5
  SHA512:
6
- metadata.gz: d4baec3704aa0874a3be6d27c87a370282eb6afe8874e9677abf3bfd360bca9d2a7ca74d33a2e268283feb08ab9e4684e95d7ec3016f2e24ea82f7e55199a6f9
7
- data.tar.gz: bf6028f8e4819f2bb821180c2e422436852a1ae6ac58f63b65fe1c298c84159e54a16d6bb497e07c65ad6ee70eda1f623663389717ef37ab20d1515f1a21a968
6
+ metadata.gz: f35bbb4dc35d24e2804fb0e443561e27fb59e4a5955dd3895bbf6341e5ef4343e78e5220b627e65d4cc9d2db63d185e10adad0374c219c1c2d0bfe16b97e2bd6
7
+ data.tar.gz: dfcde101fc4f975c81e803bf4af90e77a7719932b01fe94d7953a501b1e34049d44107b2ca9860a66b596f1614387df7d6e1c8d1f0c27293338178ed626ae973
data/CHANGELOG.md CHANGED
@@ -1,3 +1,6 @@
1
+ ## 3.1.4
2
+ - fix return of multiple events when using file based scripts #41
3
+
1
4
  ## 3.1.3
2
5
  - Fix documentation issues
3
6
 
data/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2012–2016 Elasticsearch <http://www.elastic.co>
1
+ Copyright (c) 2012-2018 Elasticsearch <http://www.elastic.co>
2
2
 
3
3
  Licensed under the Apache License, Version 2.0 (the "License");
4
4
  you may not use this file except in compliance with the License.
@@ -81,7 +81,7 @@ class LogStash::Filters::Ruby < LogStash::Filters::Base
81
81
  if @code
82
82
  inline_script(event, &block)
83
83
  elsif @path
84
- file_script(event)
84
+ file_script(event, &block)
85
85
  end
86
86
  end
87
87
 
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-ruby'
4
- s.version = '3.1.3'
4
+ s.version = '3.1.4'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Executes arbitrary Ruby code"
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"
@@ -156,5 +156,13 @@ describe LogStash::Filters::Ruby do
156
156
  end.to raise_error(LogStash::Filters::Ruby::ScriptError)
157
157
  end
158
158
  end
159
+
160
+ describe "scripts with failing test suites" do
161
+ let(:script_filename) { 'multi_events.rb' }
162
+
163
+ it "should produce more multiple events" do
164
+ expect {|b| filter.filter(incoming_event, &b) }.to yield_control.exactly(3).times
165
+ end
166
+ end
159
167
  end
160
168
  end
@@ -0,0 +1,6 @@
1
+ def register(params)
2
+ end
3
+
4
+ def filter(event)
5
+ [event.clone, event.clone, event.clone]
6
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.3
4
+ version: 3.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-06 00:00:00.000000000 Z
11
+ date: 2018-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
@@ -84,6 +84,7 @@ files:
84
84
  - spec/filters/ruby_spec.rb
85
85
  - spec/fixtures/broken.rb
86
86
  - spec/fixtures/field_multiplier.rb
87
+ - spec/fixtures/multi_events.rb
87
88
  - spec/spec_helper.rb
88
89
  homepage: http://www.elastic.co/guide/en/logstash/current/index.html
89
90
  licenses:
@@ -115,4 +116,5 @@ test_files:
115
116
  - spec/filters/ruby_spec.rb
116
117
  - spec/fixtures/broken.rb
117
118
  - spec/fixtures/field_multiplier.rb
119
+ - spec/fixtures/multi_events.rb
118
120
  - spec/spec_helper.rb