fluent-plugin-syslog_rfc5424 0.7.2 → 0.7.3.pre.rc.11

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
- SHA1:
3
- metadata.gz: 7e904557320502d2ad3c0ef6e191f86d975db51e
4
- data.tar.gz: 108731169366146f496c5fde50e48d732f3e5754
2
+ SHA256:
3
+ metadata.gz: 3aeba1bc85d4277e29e9eab6f55f3356d622d366e761fe6d2e4a09e6fd6357b5
4
+ data.tar.gz: 472056538a630900856e091898b30806de2f574d5ff60fb600705a871192d016
5
5
  SHA512:
6
- metadata.gz: d833f7032c2c86b22e9b6dac5655af28f80f2a346c4c2a051b6af5150c6e80dfa82d3314aaebc630e364da87f59c778979ed7f2bc77a4fe6b1bb1abebde27dec
7
- data.tar.gz: a11a9ad57de818c8bba185070f838b8ed24646e6650e242f880e08e7745239728ac5643328ef673688fd2a9c4614208bf72f5e25bdd896d8443627233e749b57
6
+ metadata.gz: b5c87c426d6495f62d79b78b378e2fe3e5f707e8324dd47715acee634c2a29eac7c3ebf97d51b254dcb9f59bc5bebdfd0244c6b1730f02f764f913d2c2e6c094
7
+ data.tar.gz: 0cf85fdc27458d40b65f049e0b32bcccf3cafad67b765d3717bf09b8e79f5fc0738d3682ef47fd88c12d91434c2643e6f206378d892bb35842ceb9b67b972115
@@ -1,10 +1,10 @@
1
1
 
2
2
  lib = File.expand_path("../lib", __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
-
4
+ require 'fluent-plugin-syslog_rfc5424/version'
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "fluent-plugin-syslog_rfc5424"
7
- spec.version = "0.7.2"
7
+ spec.version = FluentSyslog5424OutputPlugin::VERSION
8
8
  spec.authors = ["Pivotal"]
9
9
  spec.email = %w(cf-loggregator@pivotal.io)
10
10
  spec.homepage = "https://github.com/cloudfoundry/fluent-plugin-syslog_rfc5424"
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "test-unit", "~> 3.3"
23
23
  spec.add_development_dependency "test-unit-rr", "~> 1.0"
24
24
  spec.add_development_dependency "pry", "~> 0.12"
25
- spec.add_development_dependency "minitest", "~> 5.8"
25
+ spec.add_development_dependency "minitest", "~> 5.14"
26
26
 
27
27
  spec.add_runtime_dependency "fluentd", "~> 1.7"
28
28
  end
@@ -16,9 +16,6 @@ module Fluent
16
16
  end
17
17
 
18
18
  def format(tag, time, record)
19
- log.debug("Tag")
20
- log.debug(tag.to_s)
21
-
22
19
  log.debug("Record")
23
20
  log.debug(record.map { |k, v| "#{k}=#{v}" }.join('&'))
24
21
 
@@ -28,9 +28,11 @@ module Fluent
28
28
  tag = chunk.metadata.tag
29
29
  chunk.each do |time, record|
30
30
  begin
31
- socket.write @formatter.format(tag, time, record)
32
- rescue
33
- @sockets[socket_key(@transport.to_sym, @host, @port)] = nil
31
+ socket.write_nonblock @formatter.format(tag, time, record)
32
+ IO.select(nil, [socket], nil, 1) || raise(StandardError.new "ReconnectError")
33
+ rescue => e
34
+ @sockets.delete(socket_key(@transport.to_sym, @host, @port))
35
+ socket.close
34
36
  raise
35
37
  end
36
38
  end
@@ -54,7 +56,8 @@ module Fluent
54
56
  def socket_options
55
57
  return {} unless @transport == 'tls'
56
58
 
57
- { insecure: @insecure, verify_fqdn: !@insecure, cert_paths: @trusted_ca_path }
59
+ # TODO: make timeouts configurable
60
+ { insecure: @insecure, verify_fqdn: !@insecure, cert_paths: @trusted_ca_path } #, connect_timeout: 1, send_timeout: 1, recv_timeout: 1, linger_timeout: 1 }
58
61
  end
59
62
 
60
63
  def socket_key(transport, host, port)
@@ -0,0 +1,3 @@
1
+ module FluentSyslog5424OutputPlugin
2
+ VERSION = "0.7.3-rc.11"
3
+ end
@@ -30,10 +30,12 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
30
30
  port 123
31
31
  )
32
32
 
33
- socket = Minitest::Mock.new
34
- mock(socket).write(@formatted_log)
33
+ socket = Object.new
34
+ mock(socket).write_nonblock(@formatted_log)
35
35
  stub(socket).close
36
36
 
37
+ stub(IO).select(nil, [socket], nil, 1) { ["not an error"] }
38
+
37
39
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
38
40
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(socket)
39
41
  end
@@ -50,17 +52,17 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
50
52
  port 123
51
53
  )
52
54
 
53
- bad_socket = Minitest::Mock.new
54
- mock(bad_socket).write(@formatted_log) {
55
- raise StandardError
56
- }
55
+ bad_socket = Object.new
56
+ mock(bad_socket).write_nonblock(@formatted_log)
57
57
  stub(bad_socket).close
58
-
59
-
60
- good_socket = Minitest::Mock.new
61
- mock(good_socket).write(@formatted_log)
58
+
59
+ good_socket = Object.new
60
+ mock(good_socket).write_nonblock(@formatted_log)
62
61
  stub(good_socket).close
63
62
 
63
+ mock(IO).select(nil, [bad_socket], nil, 1)
64
+ mock(IO).select(nil, [good_socket], nil, 1) { ["not an error"] }
65
+
64
66
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
65
67
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(bad_socket)
66
68
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(good_socket)
@@ -79,10 +81,12 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
79
81
  transport tcp
80
82
  )
81
83
 
82
- socket = Minitest::Mock.new
83
- mock(socket).write(@formatted_log)
84
+ socket = Object.new
85
+ mock(socket).write_nonblock(@formatted_log)
84
86
  stub(socket).close
85
87
 
88
+ stub(IO).select(nil, [socket], nil, 1) { ["not an error"] }
89
+
86
90
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
87
91
  mock(fluent_plugin).socket_create(:tcp, "example.com", 123, {}).returns(socket)
88
92
  end
@@ -101,10 +105,12 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
101
105
  insecure true
102
106
  )
103
107
 
104
- socket = Minitest::Mock.new
105
- mock(socket).write(@formatted_log)
108
+ socket = Object.new
109
+ mock(socket).write_nonblock(@formatted_log)
106
110
  stub(socket).close
107
111
 
112
+ stub(IO).select(nil, [socket], nil, 1) { ["not an error"] }
113
+
108
114
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
109
115
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>true, :verify_fqdn=>false, :cert_paths=>nil}).returns(socket)
110
116
  end
@@ -123,10 +129,12 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
123
129
  trusted_ca_path supertrustworthy
124
130
  )
125
131
 
126
- socket = Minitest::Mock.new
127
- mock(socket).write(@formatted_log)
132
+ socket = Object.new
133
+ mock(socket).write_nonblock(@formatted_log)
128
134
  stub(socket).close
129
135
 
136
+ stub(IO).select(nil, [socket], nil, 1) { ["not an error"] }
137
+
130
138
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
131
139
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>"supertrustworthy"}).returns(socket)
132
140
  end
@@ -143,14 +151,16 @@ class OutSyslogRFC5424Test < Test::Unit::TestCase
143
151
  port 123
144
152
  )
145
153
 
146
- socket = Minitest::Mock.new
147
- stub(socket).write(@formatted_log)
154
+ socket = Object.new
155
+ stub(socket).write_nonblock(@formatted_log)
156
+ mock(socket).close
157
+
158
+ stub(IO).select(nil, [socket], nil, 1) { ["not an error"] }
148
159
 
149
160
  any_instance_of(Fluent::Plugin::OutSyslogRFC5424) do |fluent_plugin|
150
161
  mock(fluent_plugin).socket_create(:tls, "example.com", 123, {:insecure=>false, :verify_fqdn=>true, :cert_paths=>nil}).returns(socket)
151
162
  end
152
163
 
153
- mock(socket).close
154
164
  output_driver.run do
155
165
  output_driver.feed("tag", @time , {"log" => "hi"})
156
166
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-syslog_rfc5424
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3.pre.rc.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pivotal
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-30 00:00:00.000000000 Z
11
+ date: 2020-02-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '5.8'
89
+ version: '5.14'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '5.8'
96
+ version: '5.14'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: fluentd
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -123,6 +123,7 @@ files:
123
123
  - README.md
124
124
  - Rakefile
125
125
  - fluent-plugin-syslog_rfc5424.gemspec
126
+ - lib/fluent-plugin-syslog_rfc5424/version.rb
126
127
  - lib/fluent/plugin/formatter_syslog_rfc5424.rb
127
128
  - lib/fluent/plugin/out_syslog_rfc5424.rb
128
129
  - lib/rfc5424/formatter.rb
@@ -145,12 +146,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
145
146
  version: '0'
146
147
  required_rubygems_version: !ruby/object:Gem::Requirement
147
148
  requirements:
148
- - - ">="
149
+ - - ">"
149
150
  - !ruby/object:Gem::Version
150
- version: '0'
151
+ version: 1.3.1
151
152
  requirements: []
152
- rubyforge_project:
153
- rubygems_version: 2.6.13
153
+ rubygems_version: 3.1.2
154
154
  signing_key:
155
155
  specification_version: 4
156
156
  summary: FluentD output plugin to send messages via rfc5424