logstash-filter-ruby 0.1.5 → 1.0.0

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: 9ae3cf8cbdcd7c465d870b45009008e2ed13169e
4
- data.tar.gz: 5a2169d2b5e6db521242a65788c0d8bc7f39f68c
3
+ metadata.gz: 55cb524641f1a0310e905de491cd10143c7a6fdf
4
+ data.tar.gz: 68154628f270f8aba610b799ad81366a112fd4cc
5
5
  SHA512:
6
- metadata.gz: ac32b5fd7bd6bb54ba3c249f23b30fc8ebe9a71c2ce74462a65da31f073269efa9196ffc55c796aeaba5277e96314e44990fc6fd050c030aa0a76fcf98f52eb1
7
- data.tar.gz: 1f449cbea880b6f65a93dd49e1a2e861fd127484be8bbf4595d2ff5835e8649e4a6c03d1520353e0e002596a018279e91c5c88ee51fd503bfd7cd6d19849a649
6
+ metadata.gz: b63df0659d9aa64a05abcd2969e58051c03a42589978557141cce54c63f2d4f76a3665ba5d44cf657213a86444f574194a7bf757d05d5d7b3ba2c542366dff69
7
+ data.tar.gz: 5dbecadfc4fecd5a79906917ce2bd463790eb53b1f50d5b4acbe97759f56077b3184d25f1761bf7bfb70abf61ee2adc35c5b1b3c6f5489e434403593af7b2ff6
data/CHANGELOG.md ADDED
File without changes
data/NOTICE.TXT ADDED
@@ -0,0 +1,5 @@
1
+ Elasticsearch
2
+ Copyright 2012-2015 Elasticsearch
3
+
4
+ This product includes software developed by The Apache Software
5
+ Foundation (http://www.apache.org/).
data/README.md CHANGED
@@ -13,7 +13,7 @@ Logstash provides infrastructure to automatically generate documentation for thi
13
13
 
14
14
  ## Need Help?
15
15
 
16
- Need help? Try #logstash on freenode IRC or the logstash-users@googlegroups.com mailing list.
16
+ Need help? Try #logstash on freenode IRC or the https://discuss.elastic.co/c/logstash discussion forum.
17
17
 
18
18
  ## Developing
19
19
 
@@ -34,8 +34,12 @@ class LogStash::Filters::Ruby < LogStash::Filters::Base
34
34
  def filter(event)
35
35
  return unless filter?(event)
36
36
 
37
- @codeblock.call(event)
38
-
39
- filter_matched(event)
37
+ begin
38
+ @codeblock.call(event)
39
+ filter_matched(event)
40
+ rescue Exception => e
41
+ @logger.error("Ruby exception occurred: #{e}")
42
+ event.tag("_rubyexception")
43
+ end
40
44
  end # def filter
41
45
  end # class LogStash::Filters::Ruby
@@ -1,7 +1,7 @@
1
1
  Gem::Specification.new do |s|
2
2
 
3
3
  s.name = 'logstash-filter-ruby'
4
- s.version = '0.1.5'
4
+ s.version = '1.0.0'
5
5
  s.licenses = ['Apache License (2.0)']
6
6
  s.summary = "Filter for executing ruby code on the event"
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"
@@ -52,4 +52,30 @@ describe LogStash::Filters::Ruby do
52
52
  insist { subject["pretty"] } == "{\"message\":\"hello world\",\"mydate\":\"2014-09-23T00:00:00-0800\",\"@version\":\"1\",\"@timestamp\":\"2014-09-23T08:00:00.000Z\"}"
53
53
  end
54
54
  end
55
+
56
+ describe "catch all exceptions and don't let them ruin your day buy stopping the entire worker" do
57
+ # If exception is raised, it stops entine processing pipeline, and never resumes
58
+ # Code section should always be wrapped with begin/rescue
59
+ config <<-CONFIG
60
+ filter {
61
+ date {
62
+ match => [ "mydate", "ISO8601" ]
63
+ locale => "en"
64
+ timezone => "UTC"
65
+ }
66
+ ruby {
67
+ init => "require 'json'"
68
+ code => "raise 'You shall not pass'"
69
+ add_tag => ["ok"]
70
+ }
71
+ }
72
+ CONFIG
73
+
74
+ sample("message" => "hello world", "mydate" => "2014-09-23T00:00:00-0800") do
75
+ insist { subject["mydate"] } == "2014-09-23T00:00:00-0800"
76
+ insist { subject["tags"] } == ["_rubyexception"]
77
+ end
78
+ end
79
+
55
80
  end
81
+
metadata CHANGED
@@ -1,17 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-filter-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Elastic
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-20 00:00:00.000000000 Z
11
+ date: 2015-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- requirement: !ruby/object:Gem::Requirement
14
+ name: logstash-core
15
+ version_requirements: !ruby/object:Gem::Requirement
15
16
  requirements:
16
17
  - - '>='
17
18
  - !ruby/object:Gem::Version
@@ -19,10 +20,7 @@ dependencies:
19
20
  - - <
20
21
  - !ruby/object:Gem::Version
21
22
  version: 2.0.0
22
- name: logstash-core
23
- prerelease: false
24
- type: :runtime
25
- version_requirements: !ruby/object:Gem::Requirement
23
+ requirement: !ruby/object:Gem::Requirement
26
24
  requirements:
27
25
  - - '>='
28
26
  - !ruby/object:Gem::Version
@@ -30,34 +28,36 @@ dependencies:
30
28
  - - <
31
29
  - !ruby/object:Gem::Version
32
30
  version: 2.0.0
31
+ prerelease: false
32
+ type: :runtime
33
33
  - !ruby/object:Gem::Dependency
34
+ name: logstash-filter-date
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - '>='
38
+ - !ruby/object:Gem::Version
39
+ version: '0'
34
40
  requirement: !ruby/object:Gem::Requirement
35
41
  requirements:
36
42
  - - '>='
37
43
  - !ruby/object:Gem::Version
38
44
  version: '0'
39
- name: logstash-filter-date
40
45
  prerelease: false
41
46
  type: :runtime
47
+ - !ruby/object:Gem::Dependency
48
+ name: logstash-devutils
42
49
  version_requirements: !ruby/object:Gem::Requirement
43
50
  requirements:
44
51
  - - '>='
45
52
  - !ruby/object:Gem::Version
46
53
  version: '0'
47
- - !ruby/object:Gem::Dependency
48
54
  requirement: !ruby/object:Gem::Requirement
49
55
  requirements:
50
56
  - - '>='
51
57
  - !ruby/object:Gem::Version
52
58
  version: '0'
53
- name: logstash-devutils
54
59
  prerelease: false
55
60
  type: :development
56
- version_requirements: !ruby/object:Gem::Requirement
57
- requirements:
58
- - - '>='
59
- - !ruby/object:Gem::Version
60
- version: '0'
61
61
  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
62
62
  email: info@elastic.co
63
63
  executables: []
@@ -65,9 +65,11 @@ extensions: []
65
65
  extra_rdoc_files: []
66
66
  files:
67
67
  - .gitignore
68
+ - CHANGELOG.md
68
69
  - CONTRIBUTORS
69
70
  - Gemfile
70
71
  - LICENSE
72
+ - NOTICE.TXT
71
73
  - README.md
72
74
  - Rakefile
73
75
  - lib/logstash/filters/ruby.rb
@@ -95,7 +97,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
97
  version: '0'
96
98
  requirements: []
97
99
  rubyforge_project:
98
- rubygems_version: 2.1.9
100
+ rubygems_version: 2.2.2
99
101
  signing_key:
100
102
  specification_version: 4
101
103
  summary: Filter for executing ruby code on the event