fluentd 1.10.4-x64-mingw32 → 1.11.4-x64-mingw32

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fluentd might be problematic. Click here for more details.

Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +100 -0
  3. data/example/copy_roundrobin.conf +3 -3
  4. data/example/counter.conf +1 -1
  5. data/example/filter_stdout.conf +2 -2
  6. data/example/{in_dummy_blocks.conf → in_sample_blocks.conf} +4 -4
  7. data/example/{in_dummy_with_compression.conf → in_sample_with_compression.conf} +3 -3
  8. data/example/logevents.conf +5 -5
  9. data/example/multi_filters.conf +1 -1
  10. data/example/out_exec_filter.conf +2 -2
  11. data/example/out_forward.conf +1 -1
  12. data/example/out_forward_buf_file.conf +1 -1
  13. data/example/out_forward_client.conf +5 -5
  14. data/example/out_forward_heartbeat_none.conf +1 -1
  15. data/example/out_forward_sd.conf +1 -1
  16. data/example/out_forward_shared_key.conf +2 -2
  17. data/example/out_forward_tls.conf +1 -1
  18. data/example/out_forward_users.conf +3 -3
  19. data/example/out_null.conf +4 -4
  20. data/example/secondary_file.conf +1 -1
  21. data/fluentd.gemspec +5 -5
  22. data/lib/fluent/command/fluentd.rb +11 -0
  23. data/lib/fluent/log.rb +33 -3
  24. data/lib/fluent/match.rb +9 -0
  25. data/lib/fluent/plugin/buffer.rb +49 -40
  26. data/lib/fluent/plugin/buffer/chunk.rb +2 -1
  27. data/lib/fluent/plugin/in_dummy.rb +2 -123
  28. data/lib/fluent/plugin/in_exec.rb +4 -2
  29. data/lib/fluent/plugin/in_gc_stat.rb +16 -0
  30. data/lib/fluent/plugin/in_http.rb +148 -77
  31. data/lib/fluent/plugin/in_sample.rb +141 -0
  32. data/lib/fluent/plugin/in_tail.rb +2 -2
  33. data/lib/fluent/plugin/in_unix.rb +77 -77
  34. data/lib/fluent/plugin/out_http.rb +1 -1
  35. data/lib/fluent/plugin/output.rb +8 -5
  36. data/lib/fluent/plugin/parser_json.rb +5 -2
  37. data/lib/fluent/plugin/parser_syslog.rb +215 -54
  38. data/lib/fluent/plugin_helper/cert_option.rb +5 -8
  39. data/lib/fluent/plugin_helper/child_process.rb +3 -2
  40. data/lib/fluent/plugin_helper/inject.rb +2 -1
  41. data/lib/fluent/plugin_helper/socket.rb +1 -1
  42. data/lib/fluent/supervisor.rb +11 -5
  43. data/lib/fluent/system_config.rb +2 -1
  44. data/lib/fluent/version.rb +1 -1
  45. data/test/plugin/test_buffer.rb +4 -0
  46. data/test/plugin/test_in_exec.rb +18 -0
  47. data/test/plugin/test_in_gc_stat.rb +24 -1
  48. data/test/plugin/test_in_http.rb +57 -0
  49. data/test/plugin/{test_in_dummy.rb → test_in_sample.rb} +25 -25
  50. data/test/plugin/test_in_tail.rb +3 -0
  51. data/test/plugin/test_in_unix.rb +128 -72
  52. data/test/plugin/test_output.rb +12 -0
  53. data/test/plugin/test_parser_syslog.rb +66 -29
  54. data/test/plugin_helper/data/cert/empty.pem +0 -0
  55. data/test/plugin_helper/test_cert_option.rb +7 -0
  56. data/test/plugin_helper/test_child_process.rb +15 -0
  57. data/test/plugin_helper/test_http_server_helper.rb +5 -0
  58. data/test/plugin_helper/test_inject.rb +13 -0
  59. data/test/plugin_helper/test_server.rb +34 -0
  60. data/test/plugin_helper/test_socket.rb +8 -0
  61. data/test/test_log.rb +44 -0
  62. data/test/test_match.rb +11 -0
  63. data/test/test_static_config_analysis.rb +2 -2
  64. metadata +19 -16
File without changes
@@ -15,4 +15,11 @@ class CertOptionPluginHelperTest < Test::Unit::TestCase
15
15
  certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/cert-with-CRLF.pem")
16
16
  assert_equal(1, certs.length)
17
17
  end
18
+
19
+ test 'raise an error for broken certificates_from_file file' do
20
+ d = Dummy.new
21
+ assert_raise Fluent::ConfigError do
22
+ certs = d.cert_option_certificates_from_file("test/plugin_helper/data/cert/empty.pem")
23
+ end
24
+ end
18
25
  end
@@ -818,5 +818,20 @@ class ChildProcessTest < Test::Unit::TestCase
818
818
  end
819
819
  assert File.exist?(@temp_path)
820
820
  end
821
+
822
+ test 'execute child process writing data to stdout which is unread' do
823
+ callback_called = false
824
+ exit_status = nil
825
+ prog = "echo writing to stdout"
826
+ callback = ->(status){ exit_status = status; callback_called = true }
827
+ Timeout.timeout(TEST_DEADLOCK_TIMEOUT) do
828
+ @d.child_process_execute(:out_exec_process, prog, stderr: :connect, immediate: true, parallel: true, mode: [], wait_timeout: 1, on_exit_callback: callback)
829
+ sleep TEST_WAIT_INTERVAL_FOR_BLOCK_RUNNING until callback_called
830
+ end
831
+ assert callback_called
832
+ assert exit_status
833
+ assert exit_status.success?
834
+ assert_equal 0, exit_status.exitstatus
835
+ end
821
836
  end
822
837
  end
@@ -278,6 +278,7 @@ class HttpHelperTest < Test::Unit::TestCase
278
278
  driver.http_server_create_https_server(:http_server_helper_test_tls, addr: '127.0.0.1', port: PORT, logger: NULL_LOGGER) do |s|
279
279
  s.get('/example/hello') { [200, { 'Content-Type' => 'text/plain' }, 'hello get'] }
280
280
  end
281
+ omit "TLS connection should be aborted due to `Errno::ECONNABORTED`. Need to debug." if Fluent.windows?
281
282
 
282
283
  resp = secure_get("https://127.0.0.1:#{PORT}/example/hello", verify: false)
283
284
  assert_equal('200', resp.code)
@@ -293,6 +294,8 @@ class HttpHelperTest < Test::Unit::TestCase
293
294
  'with passphrase' => ['apple', 'cert-pass.pem', 'cert-key-pass.pem'],
294
295
  'without passphrase' => [nil, 'cert.pem', 'cert-key.pem'])
295
296
  test 'load self-signed cert/key pair, verified from clients using cert files' do |(passphrase, cert, private_key)|
297
+ omit "Self signed certificate blocks TLS connection. Need to debug." if Fluent.windows?
298
+
296
299
  cert_path = File.join(CERT_DIR, cert)
297
300
  private_key_path = File.join(CERT_DIR, private_key)
298
301
  opt = { 'insecure' => 'false', 'private_key_path' => private_key_path, 'cert_path' => cert_path }
@@ -315,6 +318,8 @@ class HttpHelperTest < Test::Unit::TestCase
315
318
  'with passphrase' => ['apple', 'cert-pass.pem', 'cert-key-pass.pem', 'ca-cert-pass.pem'],
316
319
  'without passphrase' => [nil, 'cert.pem', 'cert-key.pem', 'ca-cert.pem'])
317
320
  test 'load cert by private CA cert file, verified from clients using CA cert file' do |(passphrase, cert, cert_key, ca_cert)|
321
+ omit "Self signed certificate blocks TLS connection. Need to debug." if Fluent.windows?
322
+
318
323
  cert_path = File.join(CERT_CA_DIR, cert)
319
324
  private_key_path = File.join(CERT_CA_DIR, cert_key)
320
325
 
@@ -176,6 +176,19 @@ class InjectHelperTest < Test::Unit::TestCase
176
176
  assert_equal record.merge({"timedata" => float_time}), @d.inject_values_to_record('tag', time, record)
177
177
  end
178
178
 
179
+ test 'injects time as unix time millis into specified key' do
180
+ time_in_unix = Time.parse("2016-06-21 08:10:11 +0900").to_i
181
+ time_subsecond = 320_101_224
182
+ time = Fluent::EventTime.new(time_in_unix, time_subsecond)
183
+ unixtime_millis = 1466464211320
184
+
185
+ @d.configure(config_inject_section("time_key" => "timedata", "time_type" => "unixtime_millis"))
186
+ @d.start
187
+
188
+ record = {"key1" => "value1", "key2" => 2}
189
+ assert_equal record.merge({"timedata" => unixtime_millis}), @d.inject_values_to_record('tag', time, record)
190
+ end
191
+
179
192
  test 'injects time as unix time into specified key' do
180
193
  time_in_unix = Time.parse("2016-06-21 08:10:11 +0900").to_i
181
194
  time_subsecond = 320_101_224
@@ -1233,6 +1233,40 @@ class ServerPluginHelperTest < Test::Unit::TestCase
1233
1233
  waiting(10){ sleep 0.1 until received.bytesize == 8 }
1234
1234
  assert_equal "yay\nfoo\n", received
1235
1235
  end
1236
+
1237
+ test 'set ciphers' do
1238
+ cert_path = File.join(@server_cert_dir, "cert.pem")
1239
+ private_key_path = File.join(@certs_dir, "server.key.pem")
1240
+ create_server_pair_signed_by_self(cert_path, private_key_path, nil)
1241
+ tls_options = {
1242
+ protocol: :tls,
1243
+ version: :TLSv1_2,
1244
+ ciphers: 'SHA256',
1245
+ insecure: false,
1246
+ cert_path: cert_path,
1247
+ private_key_path: private_key_path,
1248
+ }
1249
+ conf = @d.server_create_transport_section_object(tls_options)
1250
+ ctx = @d.cert_option_create_context(conf.version, conf.insecure, conf.ciphers, conf)
1251
+ matched = false
1252
+ ctx.ciphers.each do |cipher|
1253
+ cipher_name, tls_version = cipher
1254
+ # OpenSSL 1.0.2: "TLSv1/SSLv3"
1255
+ # OpenSSL 1.1.1: "TLSv1.2"
1256
+ if tls_version == "TLSv1/SSLv3" || tls_version == "TLSv1.2"
1257
+ matched = true
1258
+ unless cipher_name.match(/#{conf.ciphers}/)
1259
+ matched = false
1260
+ break
1261
+ end
1262
+ end
1263
+ end
1264
+
1265
+ error_msg = build_message("Unexpected ciphers for #{conf.version}",
1266
+ "<?>\nwas expected to include only <?> ciphers for #{conf.version}",
1267
+ ctx.ciphers, conf.ciphers)
1268
+ assert(matched, error_msg)
1269
+ end
1236
1270
  end
1237
1271
  end
1238
1272
 
@@ -128,4 +128,12 @@ class SocketHelperTest < Test::Unit::TestCase
128
128
  client.close
129
129
  end
130
130
  end
131
+
132
+ test 'with empty cert file' do
133
+ cert_path = File.expand_path(File.dirname(__FILE__) + '/data/cert/empty.pem')
134
+
135
+ assert_raise Fluent::ConfigError do
136
+ SocketHelperTestPlugin.new.socket_create_tls('127.0.0.1', PORT, cert_path: cert_path)
137
+ end
138
+ end
131
139
  end
@@ -411,6 +411,50 @@ class LogTest < Test::Unit::TestCase
411
411
  end
412
412
  end
413
413
 
414
+ sub_test_case "ignore_same_log_interval" do
415
+ teardown do
416
+ Thread.current[:last_same_log] = nil
417
+ end
418
+
419
+ def test_same_message
420
+ message = "This is test"
421
+ logger = ServerEngine::DaemonLogger.new(@log_device, {log_level: ServerEngine::DaemonLogger::INFO})
422
+ log = Fluent::Log.new(logger, {ignore_same_log_interval: 5})
423
+
424
+ log.error message
425
+ 10.times { |i|
426
+ Timecop.freeze(@timestamp + i + 1)
427
+ log.error message
428
+ }
429
+
430
+ expected = [
431
+ "2016-04-21 02:58:41 +0000 [error]: This is test\n",
432
+ "2016-04-21 02:58:47 +0000 [error]: This is test\n"
433
+ ]
434
+ assert_equal(expected, log.out.logs)
435
+ end
436
+
437
+ def test_different_message
438
+ message = "This is test"
439
+ logger = ServerEngine::DaemonLogger.new(@log_device, {log_level: ServerEngine::DaemonLogger::INFO})
440
+ log = Fluent::Log.new(logger, {ignore_same_log_interval: 10})
441
+
442
+ log.error message
443
+ 3.times { |i|
444
+ Timecop.freeze(@timestamp + i)
445
+ log.error message
446
+ log.error message
447
+ log.info "Hello! " + message
448
+ }
449
+
450
+ expected = [
451
+ "2016-04-21 02:58:41 +0000 [error]: This is test\n",
452
+ "2016-04-21 02:58:41 +0000 [info]: Hello! This is test\n",
453
+ ]
454
+ assert_equal(expected, log.out.logs)
455
+ end
456
+ end
457
+
414
458
  def test_dup
415
459
  dl_opts = {}
416
460
  dl_opts[:log_level] = ServerEngine::DaemonLogger::TRACE
@@ -101,6 +101,17 @@ class MatchTest < Test::Unit::TestCase
101
101
  assert_or_not_match('a.b.** a.c', 'a.c.d')
102
102
  end
103
103
 
104
+ def test_regex_pattern
105
+ assert_glob_match('/a/', 'a')
106
+ assert_glob_not_match('/a/', 'abc')
107
+ assert_glob_match('/a.*/', 'abc')
108
+ assert_glob_not_match('/b.*/', 'abc')
109
+ assert_glob_match('/a\..*/', 'a.b.c')
110
+ assert_glob_not_match('/(?!a\.).*/', 'a.b.c')
111
+ assert_glob_not_match('/a\..*/', 'b.b.c')
112
+ assert_glob_match('/(?!a\.).*/', 'b.b.c')
113
+ end
114
+
104
115
  #def test_character_class
105
116
  # assert_match('[a]', 'a')
106
117
  # assert_match('[ab]', 'a')
@@ -6,7 +6,7 @@ require 'fluent/plugin/out_forward'
6
6
  require 'fluent/plugin/out_stdout'
7
7
  require 'fluent/plugin/out_exec'
8
8
  require 'fluent/plugin/in_forward'
9
- require 'fluent/plugin/in_dummy'
9
+ require 'fluent/plugin/in_sample'
10
10
  require 'fluent/plugin/filter_grep'
11
11
  require 'fluent/plugin/filter_stdout'
12
12
  require 'fluent/plugin/filter_parser'
@@ -74,7 +74,7 @@ class StaticConfigAnalysisTest < ::Test::Unit::TestCase
74
74
  c = Fluent::Config.parse(conf_data, '(test)', '(test_dir)', true)
75
75
  ret = Fluent::StaticConfigAnalysis.call(c)
76
76
  assert_equal [Fluent::Plugin::ExecOutput, Fluent::Plugin::StdoutOutput, Fluent::Plugin::ForwardOutput], ret.outputs.map(&:plugin).map(&:class)
77
- assert_equal [Fluent::Plugin::DummyInput, Fluent::Plugin::ForwardInput], ret.inputs.map(&:plugin).map(&:class)
77
+ assert_equal [Fluent::Plugin::SampleInput, Fluent::Plugin::ForwardInput], ret.inputs.map(&:plugin).map(&:class)
78
78
  assert_equal [Fluent::Plugin::ParserFilter, Fluent::Plugin::StdoutFilter, Fluent::Plugin::GrepFilter], ret.filters.map(&:plugin).map(&:class)
79
79
  assert_equal 1, ret.labels.size
80
80
  assert_equal '@test', ret.labels[0].name
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluentd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.4
4
+ version: 1.11.4
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-12 00:00:00.000000000 Z
11
+ date: 2020-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -178,70 +178,70 @@ dependencies:
178
178
  requirements:
179
179
  - - "~>"
180
180
  - !ruby/object:Gem::Version
181
- version: 0.8.3
181
+ version: 2.1.5
182
182
  type: :runtime
183
183
  prerelease: false
184
184
  version_requirements: !ruby/object:Gem::Requirement
185
185
  requirements:
186
186
  - - "~>"
187
187
  - !ruby/object:Gem::Version
188
- version: 0.8.3
188
+ version: 2.1.5
189
189
  - !ruby/object:Gem::Dependency
190
190
  name: win32-ipc
191
191
  requirement: !ruby/object:Gem::Requirement
192
192
  requirements:
193
193
  - - "~>"
194
194
  - !ruby/object:Gem::Version
195
- version: 0.6.1
195
+ version: 0.7.0
196
196
  type: :runtime
197
197
  prerelease: false
198
198
  version_requirements: !ruby/object:Gem::Requirement
199
199
  requirements:
200
200
  - - "~>"
201
201
  - !ruby/object:Gem::Version
202
- version: 0.6.1
202
+ version: 0.7.0
203
203
  - !ruby/object:Gem::Dependency
204
204
  name: win32-event
205
205
  requirement: !ruby/object:Gem::Requirement
206
206
  requirements:
207
207
  - - "~>"
208
208
  - !ruby/object:Gem::Version
209
- version: 0.6.1
209
+ version: 0.6.3
210
210
  type: :runtime
211
211
  prerelease: false
212
212
  version_requirements: !ruby/object:Gem::Requirement
213
213
  requirements:
214
214
  - - "~>"
215
215
  - !ruby/object:Gem::Version
216
- version: 0.6.1
216
+ version: 0.6.3
217
217
  - !ruby/object:Gem::Dependency
218
218
  name: windows-pr
219
219
  requirement: !ruby/object:Gem::Requirement
220
220
  requirements:
221
221
  - - "~>"
222
222
  - !ruby/object:Gem::Version
223
- version: 1.2.5
223
+ version: 1.2.6
224
224
  type: :runtime
225
225
  prerelease: false
226
226
  version_requirements: !ruby/object:Gem::Requirement
227
227
  requirements:
228
228
  - - "~>"
229
229
  - !ruby/object:Gem::Version
230
- version: 1.2.5
230
+ version: 1.2.6
231
231
  - !ruby/object:Gem::Dependency
232
232
  name: certstore_c
233
233
  requirement: !ruby/object:Gem::Requirement
234
234
  requirements:
235
235
  - - "~>"
236
236
  - !ruby/object:Gem::Version
237
- version: 0.1.2
237
+ version: 0.1.7
238
238
  type: :runtime
239
239
  prerelease: false
240
240
  version_requirements: !ruby/object:Gem::Requirement
241
241
  requirements:
242
242
  - - "~>"
243
243
  - !ruby/object:Gem::Version
244
- version: 0.1.2
244
+ version: 0.1.7
245
245
  - !ruby/object:Gem::Dependency
246
246
  name: rake
247
247
  requirement: !ruby/object:Gem::Requirement
@@ -458,8 +458,6 @@ files:
458
458
  - example/copy_roundrobin.conf
459
459
  - example/counter.conf
460
460
  - example/filter_stdout.conf
461
- - example/in_dummy_blocks.conf
462
- - example/in_dummy_with_compression.conf
463
461
  - example/in_forward.conf
464
462
  - example/in_forward_client.conf
465
463
  - example/in_forward_shared_key.conf
@@ -468,6 +466,8 @@ files:
468
466
  - example/in_forward_workers.conf
469
467
  - example/in_http.conf
470
468
  - example/in_out_forward.conf
469
+ - example/in_sample_blocks.conf
470
+ - example/in_sample_with_compression.conf
471
471
  - example/in_syslog.conf
472
472
  - example/in_tail.conf
473
473
  - example/in_tcp.conf
@@ -605,6 +605,7 @@ files:
605
605
  - lib/fluent/plugin/in_http.rb
606
606
  - lib/fluent/plugin/in_monitor_agent.rb
607
607
  - lib/fluent/plugin/in_object_space.rb
608
+ - lib/fluent/plugin/in_sample.rb
608
609
  - lib/fluent/plugin/in_syslog.rb
609
610
  - lib/fluent/plugin/in_tail.rb
610
611
  - lib/fluent/plugin/in_tail/position_file.rb
@@ -815,13 +816,13 @@ files:
815
816
  - test/plugin/test_formatter_single_value.rb
816
817
  - test/plugin/test_formatter_tsv.rb
817
818
  - test/plugin/test_in_debug_agent.rb
818
- - test/plugin/test_in_dummy.rb
819
819
  - test/plugin/test_in_exec.rb
820
820
  - test/plugin/test_in_forward.rb
821
821
  - test/plugin/test_in_gc_stat.rb
822
822
  - test/plugin/test_in_http.rb
823
823
  - test/plugin/test_in_monitor_agent.rb
824
824
  - test/plugin/test_in_object_space.rb
825
+ - test/plugin/test_in_sample.rb
825
826
  - test/plugin/test_in_syslog.rb
826
827
  - test/plugin/test_in_tail.rb
827
828
  - test/plugin/test_in_tcp.rb
@@ -877,6 +878,7 @@ files:
877
878
  - test/plugin_helper/data/cert/cert_chains/ca-cert.pem
878
879
  - test/plugin_helper/data/cert/cert_chains/cert-key.pem
879
880
  - test/plugin_helper/data/cert/cert_chains/cert.pem
881
+ - test/plugin_helper/data/cert/empty.pem
880
882
  - test/plugin_helper/data/cert/generate_cert.rb
881
883
  - test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem
882
884
  - test/plugin_helper/data/cert/with_ca/ca-cert-key.pem
@@ -1048,13 +1050,13 @@ test_files:
1048
1050
  - test/plugin/test_formatter_single_value.rb
1049
1051
  - test/plugin/test_formatter_tsv.rb
1050
1052
  - test/plugin/test_in_debug_agent.rb
1051
- - test/plugin/test_in_dummy.rb
1052
1053
  - test/plugin/test_in_exec.rb
1053
1054
  - test/plugin/test_in_forward.rb
1054
1055
  - test/plugin/test_in_gc_stat.rb
1055
1056
  - test/plugin/test_in_http.rb
1056
1057
  - test/plugin/test_in_monitor_agent.rb
1057
1058
  - test/plugin/test_in_object_space.rb
1059
+ - test/plugin/test_in_sample.rb
1058
1060
  - test/plugin/test_in_syslog.rb
1059
1061
  - test/plugin/test_in_tail.rb
1060
1062
  - test/plugin/test_in_tcp.rb
@@ -1110,6 +1112,7 @@ test_files:
1110
1112
  - test/plugin_helper/data/cert/cert_chains/ca-cert.pem
1111
1113
  - test/plugin_helper/data/cert/cert_chains/cert-key.pem
1112
1114
  - test/plugin_helper/data/cert/cert_chains/cert.pem
1115
+ - test/plugin_helper/data/cert/empty.pem
1113
1116
  - test/plugin_helper/data/cert/generate_cert.rb
1114
1117
  - test/plugin_helper/data/cert/with_ca/ca-cert-key-pass.pem
1115
1118
  - test/plugin_helper/data/cert/with_ca/ca-cert-key.pem