fluentd 1.10.1 → 1.11.1

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 (62) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +112 -1
  3. data/CONTRIBUTING.md +1 -1
  4. data/lib/fluent/command/debug.rb +1 -0
  5. data/lib/fluent/command/fluentd.rb +12 -1
  6. data/lib/fluent/config.rb +1 -0
  7. data/lib/fluent/log.rb +45 -6
  8. data/lib/fluent/match.rb +1 -1
  9. data/lib/fluent/plugin/in_dummy.rb +2 -2
  10. data/lib/fluent/plugin/in_forward.rb +2 -2
  11. data/lib/fluent/plugin/in_gc_stat.rb +16 -0
  12. data/lib/fluent/plugin/in_http.rb +146 -75
  13. data/lib/fluent/plugin/in_monitor_agent.rb +1 -1
  14. data/lib/fluent/plugin/in_syslog.rb +4 -4
  15. data/lib/fluent/plugin/in_tail.rb +4 -4
  16. data/lib/fluent/plugin/in_unix.rb +77 -77
  17. data/lib/fluent/plugin/out_copy.rb +1 -1
  18. data/lib/fluent/plugin/out_file.rb +1 -1
  19. data/lib/fluent/plugin/out_forward.rb +23 -18
  20. data/lib/fluent/plugin/out_forward/load_balancer.rb +1 -1
  21. data/lib/fluent/plugin/out_http.rb +15 -2
  22. data/lib/fluent/plugin/parser_multiline.rb +1 -1
  23. data/lib/fluent/plugin/parser_syslog.rb +215 -54
  24. data/lib/fluent/plugin_helper/child_process.rb +3 -2
  25. data/lib/fluent/plugin_helper/record_accessor.rb +14 -0
  26. data/lib/fluent/plugin_helper/service_discovery.rb +7 -0
  27. data/lib/fluent/plugin_helper/service_discovery/manager.rb +8 -0
  28. data/lib/fluent/plugin_helper/socket.rb +20 -2
  29. data/lib/fluent/plugin_helper/socket_option.rb +2 -2
  30. data/lib/fluent/supervisor.rb +21 -9
  31. data/lib/fluent/system_config.rb +2 -1
  32. data/lib/fluent/test/filter_test.rb +2 -2
  33. data/lib/fluent/test/output_test.rb +3 -3
  34. data/lib/fluent/version.rb +1 -1
  35. data/test/command/test_fluentd.rb +57 -10
  36. data/test/config/test_system_config.rb +2 -0
  37. data/test/plugin/out_forward/test_load_balancer.rb +46 -0
  38. data/test/plugin/test_in_gc_stat.rb +24 -1
  39. data/test/plugin/test_in_http.rb +57 -0
  40. data/test/plugin/test_in_syslog.rb +1 -1
  41. data/test/plugin/test_in_tail.rb +20 -16
  42. data/test/plugin/test_in_unix.rb +128 -73
  43. data/test/plugin/test_out_forward.rb +11 -2
  44. data/test/plugin/test_out_http.rb +38 -0
  45. data/test/plugin/test_out_null.rb +1 -1
  46. data/test/plugin/test_output_as_buffered_retries.rb +12 -4
  47. data/test/plugin/test_parser_syslog.rb +66 -29
  48. data/test/plugin_helper/data/cert/cert_chains/ca-cert-key.pem +27 -0
  49. data/test/plugin_helper/data/cert/cert_chains/ca-cert.pem +20 -0
  50. data/test/plugin_helper/data/cert/cert_chains/cert-key.pem +27 -0
  51. data/test/plugin_helper/data/cert/cert_chains/cert.pem +40 -0
  52. data/test/plugin_helper/data/cert/generate_cert.rb +38 -0
  53. data/test/plugin_helper/http_server/test_app.rb +1 -1
  54. data/test/plugin_helper/http_server/test_route.rb +1 -1
  55. data/test/plugin_helper/test_child_process.rb +15 -0
  56. data/test/plugin_helper/test_http_server_helper.rb +2 -2
  57. data/test/plugin_helper/test_record_accessor.rb +41 -0
  58. data/test/plugin_helper/test_server.rb +1 -1
  59. data/test/plugin_helper/test_service_discovery.rb +37 -4
  60. data/test/plugin_helper/test_socket.rb +131 -0
  61. data/test/test_log.rb +44 -0
  62. metadata +12 -2
@@ -80,6 +80,8 @@ class HTTPOutputTest < Test::Unit::TestCase
80
80
  req.body.each_line { |l|
81
81
  data << JSON.parse(l)
82
82
  }
83
+ when 'application/json'
84
+ data = JSON.parse(req.body)
83
85
  when 'text/plain'
84
86
  # Use single_value in this test
85
87
  req.body.each_line { |line|
@@ -181,6 +183,19 @@ class HTTPOutputTest < Test::Unit::TestCase
181
183
  assert_not_match(/Status code 503 is going to be removed/, d.instance.log.out.logs.join)
182
184
  end
183
185
 
186
+ # Check if an exception is raised on not JSON format use
187
+ data('not_json' => 'msgpack')
188
+ def test_configure_with_json_array_err(format_type)
189
+ assert_raise(Fluent::ConfigError) do
190
+ create_driver(config + %[
191
+ json_array true
192
+ <format>
193
+ @type #{format_type}
194
+ </format>
195
+ ])
196
+ end
197
+ end
198
+
184
199
  data('json' => ['json', 'application/x-ndjson'],
185
200
  'ltsv' => ['ltsv', 'text/tab-separated-values'],
186
201
  'msgpack' => ['msgpack', 'application/x-msgpack'],
@@ -195,6 +210,14 @@ class HTTPOutputTest < Test::Unit::TestCase
195
210
  assert_equal content_type, d.instance.content_type
196
211
  end
197
212
 
213
+ # Check that json_array setting sets content_type = application/json
214
+ data('json' => 'application/json')
215
+ def test_configure_content_type_json_array(content_type)
216
+ d = create_driver(config + "json_array true")
217
+
218
+ assert_equal content_type, d.instance.content_type
219
+ end
220
+
198
221
  data('PUT' => 'put', 'POST' => 'post')
199
222
  def test_write_with_method(method)
200
223
  d = create_driver(config + "http_method #{method}")
@@ -211,6 +234,21 @@ class HTTPOutputTest < Test::Unit::TestCase
211
234
  assert_not_empty result.headers
212
235
  end
213
236
 
237
+ # Check that JSON at HTTP request body is valid
238
+ def test_write_with_json_array_setting
239
+ d = create_driver(config + "json_array true")
240
+ d.run(default_tag: 'test.http') do
241
+ test_events.each { |event|
242
+ d.feed(event)
243
+ }
244
+ end
245
+
246
+ result = @@result
247
+ assert_equal 'application/json', result.content_type
248
+ assert_equal test_events, result.data
249
+ assert_not_empty result.headers
250
+ end
251
+
214
252
  def test_write_with_single_value_format
215
253
  d = create_driver(config + %[
216
254
  <format>
@@ -40,7 +40,7 @@ class NullOutputTest < Test::Unit::TestCase
40
40
  assert_equal [], d.instance.chunk_keys
41
41
  end
42
42
 
43
- test 'writes standard formattted chunks' do
43
+ test 'writes standard formatted chunks' do
44
44
  d = create_driver(config_element("ROOT", "", {}, [config_element("buffer")]))
45
45
  t = event_time("2016-05-23 00:22:13 -0800")
46
46
  d.run(default_tag: 'test', flush: true) do
@@ -895,17 +895,25 @@ class BufferedOutputRetryTest < Test::Unit::TestCase
895
895
 
896
896
  @i.flush_thread_wakeup
897
897
  waiting(4){ Thread.pass until @i.write_count > 0 }
898
+ waiting(4) do
899
+ state = @i.instance_variable_get(:@output_flush_threads).first
900
+ state.thread.status == 'sleep'
901
+ end
898
902
 
899
- assert{ @i.write_count > 0 }
900
- assert{ @i.num_errors > 0 }
903
+ assert(@i.write_count > 0)
904
+ assert(@i.num_errors > 0)
901
905
 
902
906
  now = @i.next_flush_time
903
907
  Timecop.freeze( now )
904
908
  @i.flush_thread_wakeup
905
909
  waiting(4){ Thread.pass until @i.write_count > 1 }
910
+ waiting(4) do
911
+ state = @i.instance_variable_get(:@output_flush_threads).first
912
+ state.thread.status == 'sleep'
913
+ end
906
914
 
907
- assert{ @i.write_count > 1 }
908
- assert{ @i.num_errors > 1 }
915
+ assert(@i.write_count > 1)
916
+ assert(@i.num_errors > 1)
909
917
  end
910
918
  end
911
919
  end
@@ -35,8 +35,9 @@ class SyslogParserTest < ::Test::Unit::TestCase
35
35
  assert_equal('%b %d %M:%S:%H', @parser.instance.patterns['time_format'])
36
36
  end
37
37
 
38
- def test_parse_with_time_format2
39
- @parser.configure('time_format' => '%Y-%m-%dT%H:%M:%SZ')
38
+ data('regexp' => 'regexp', 'string' => 'string')
39
+ def test_parse_with_time_format2(param)
40
+ @parser.configure('time_format' => '%Y-%m-%dT%H:%M:%SZ', 'parser_type' => param)
40
41
  @parser.instance.parse('2020-03-03T10:14:29Z 192.168.0.1 fluentd[11111]: [error] Syslog test') { |time, record|
41
42
  assert_equal(event_time('Mar 03 10:14:29', format: '%b %d %H:%M:%S'), time)
42
43
  assert_equal(@expected, record)
@@ -198,11 +199,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
198
199
  end
199
200
 
200
201
  class TestRFC5424Regexp < self
201
- def test_parse_with_rfc5424_message
202
+ data('regexp' => 'regexp', 'string' => 'string')
203
+ def test_parse_with_rfc5424_message(param)
202
204
  @parser.configure(
203
205
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
204
206
  'message_format' => 'rfc5424',
205
207
  'with_priority' => true,
208
+ 'parser_type' => param
206
209
  )
207
210
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
208
211
  @parser.instance.parse(text) do |time, record|
@@ -215,11 +218,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
215
218
  assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
216
219
  end
217
220
 
218
- def test_parse_with_rfc5424_message_trailing_eol
221
+ data('regexp' => 'regexp', 'string' => 'string')
222
+ def test_parse_with_rfc5424_message_trailing_eol(param)
219
223
  @parser.configure(
220
224
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
221
225
  'message_format' => 'rfc5424',
222
226
  'with_priority' => true,
227
+ 'parser_type' => param
223
228
  )
224
229
  text = "<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!\n"
225
230
  @parser.instance.parse(text) do |time, record|
@@ -232,11 +237,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
232
237
  assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
233
238
  end
234
239
 
235
- def test_parse_with_rfc5424_multiline_message
240
+ data('regexp' => 'regexp', 'string' => 'string')
241
+ def test_parse_with_rfc5424_multiline_message(param)
236
242
  @parser.configure(
237
243
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
238
244
  'message_format' => 'rfc5424',
239
245
  'with_priority' => true,
246
+ 'parser_type' => param
240
247
  )
241
248
  text = "<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi,\nfrom\nFluentd!"
242
249
  @parser.instance.parse(text) do |time, record|
@@ -249,10 +256,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
249
256
  assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
250
257
  end
251
258
 
252
- def test_parse_with_rfc5424_message_and_without_priority
259
+ data('regexp' => 'regexp', 'string' => 'string')
260
+ def test_parse_with_rfc5424_message_and_without_priority(param)
253
261
  @parser.configure(
254
262
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
255
263
  'message_format' => 'rfc5424',
264
+ 'parser_type' => param
256
265
  )
257
266
  text = '2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
258
267
  @parser.instance.parse(text) do |time, record|
@@ -265,10 +274,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
265
274
  assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
266
275
  end
267
276
 
268
- def test_parse_with_rfc5424_empty_message_and_without_priority
277
+ data('regexp' => 'regexp', 'string' => 'string')
278
+ def test_parse_with_rfc5424_empty_message_and_without_priority(param)
269
279
  @parser.configure(
270
280
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
271
281
  'message_format' => 'rfc5424',
282
+ 'parser_type' => param
272
283
  )
273
284
  text = '2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - -'
274
285
  @parser.instance.parse(text) do |time, record|
@@ -281,10 +292,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
281
292
  assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
282
293
  end
283
294
 
284
- def test_parse_with_rfc5424_message_without_time_format
295
+ data('regexp' => 'regexp', 'string' => 'string')
296
+ def test_parse_with_rfc5424_message_without_time_format(param)
285
297
  @parser.configure(
286
298
  'message_format' => 'rfc5424',
287
299
  'with_priority' => true,
300
+ 'parser_type' => param
288
301
  )
289
302
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
290
303
  @parser.instance.parse(text) do |time, record|
@@ -296,10 +309,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
296
309
  end
297
310
  end
298
311
 
299
- def test_parse_with_rfc5424_message_with_priority_and_pid
312
+ data('regexp' => 'regexp', 'string' => 'string')
313
+ def test_parse_with_rfc5424_message_with_priority_and_pid(param)
300
314
  @parser.configure(
301
315
  'message_format' => 'rfc5424',
302
316
  'with_priority' => true,
317
+ 'parser_type' => param
303
318
  )
304
319
  text = '<28>1 2018-09-26T15:54:26.620412+09:00 machine minissdpd 1298 - - peer 192.168.0.5:50123 is not from a LAN'
305
320
  @parser.instance.parse(text) do |time, record|
@@ -311,11 +326,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
311
326
  end
312
327
  end
313
328
 
314
- def test_parse_with_rfc5424_structured_message
329
+ data('regexp' => 'regexp', 'string' => 'string')
330
+ def test_parse_with_rfc5424_structured_message(param)
315
331
  @parser.configure(
316
332
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
317
333
  'message_format' => 'rfc5424',
318
334
  'with_priority' => true,
335
+ 'parser_type' => param
319
336
  )
320
337
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi] from Fluentd!'
321
338
  @parser.instance.parse(text) do |time, record|
@@ -328,11 +345,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
328
345
  end
329
346
  end
330
347
 
331
- def test_parse_with_rfc5424_multiple_structured_message
348
+ data('regexp' => 'regexp', 'string' => 'string')
349
+ def test_parse_with_rfc5424_multiple_structured_message(param)
332
350
  @parser.configure(
333
351
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
334
352
  'message_format' => 'rfc5424',
335
353
  'with_priority' => true,
354
+ 'parser_type' => param
336
355
  )
337
356
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"][exampleSDID@20224 class="high"] Hi, from Fluentd!'
338
357
  @parser.instance.parse(text) do |time, record|
@@ -345,11 +364,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
345
364
  end
346
365
  end
347
366
 
348
- def test_parse_with_rfc5424_message_includes_right_bracket
367
+ data('regexp' => 'regexp', 'string' => 'string')
368
+ def test_parse_with_rfc5424_message_includes_right_bracket(param)
349
369
  @parser.configure(
350
370
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
351
371
  'message_format' => 'rfc5424',
352
372
  'with_priority' => true,
373
+ 'parser_type' => param
353
374
  )
354
375
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] [Hi] from Fluentd]!'
355
376
  @parser.instance.parse(text) do |time, record|
@@ -362,11 +383,13 @@ class SyslogParserTest < ::Test::Unit::TestCase
362
383
  end
363
384
  end
364
385
 
365
- def test_parse_with_rfc5424_empty_message
386
+ data('regexp' => 'regexp', 'string' => 'string')
387
+ def test_parse_with_rfc5424_empty_message(param)
366
388
  @parser.configure(
367
389
  'time_format' => '%Y-%m-%dT%H:%M:%S.%L%z',
368
390
  'message_format' => 'rfc5424',
369
391
  'with_priority' => true,
392
+ 'parser_type' => param
370
393
  )
371
394
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"]'
372
395
  @parser.instance.parse(text) do |time, record|
@@ -379,10 +402,35 @@ class SyslogParserTest < ::Test::Unit::TestCase
379
402
  end
380
403
  end
381
404
 
382
- def test_parse_with_rfc5424_message_without_subseconds
405
+ data('regexp' => 'regexp', 'string' => 'string')
406
+ def test_parse_with_rfc5424_space_empty_message(param)
407
+ @parser.configure(
408
+ 'message_format' => 'rfc5424',
409
+ 'with_priority' => true,
410
+ 'parser_type' => param
411
+ )
412
+ text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] '
413
+ @parser.instance.parse(text) do |time, record|
414
+ if param == 'string'
415
+ assert_equal(event_time("2017-02-06T13:14:15.003Z", format: '%Y-%m-%dT%H:%M:%S.%L%z'), time)
416
+ assert_equal "11111", record["pid"]
417
+ assert_equal "ID24224", record["msgid"]
418
+ assert_equal "[exampleSDID@20224 iut=\"3\" eventSource=\"Application\" eventID=\"11211\"]",
419
+ record["extradata"]
420
+ assert_equal '', record["message"]
421
+ else
422
+ assert_nil time
423
+ assert_nil record
424
+ end
425
+ end
426
+ end
427
+
428
+ data('regexp' => 'regexp', 'string' => 'string')
429
+ def test_parse_with_rfc5424_message_without_subseconds(param)
383
430
  @parser.configure(
384
431
  'message_format' => 'rfc5424',
385
432
  'with_priority' => true,
433
+ 'parser_type' => param
386
434
  )
387
435
  text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
388
436
  @parser.instance.parse(text) do |time, record|
@@ -394,10 +442,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
394
442
  end
395
443
  end
396
444
 
397
- def test_parse_with_rfc5424_message_both_timestamp
445
+ data('regexp' => 'regexp', 'string' => 'string')
446
+ def test_parse_with_rfc5424_message_both_timestamp(param)
398
447
  @parser.configure(
399
448
  'message_format' => 'rfc5424',
400
449
  'with_priority' => true,
450
+ 'parser_type' => param
401
451
  )
402
452
  text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
403
453
  @parser.instance.parse(text) do |time, record|
@@ -431,7 +481,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
431
481
  assert_equal(event_time("Feb 28 00:00:12", format: '%b %d %M:%S:%H'), time)
432
482
  assert_equal(@expected, record)
433
483
  end
434
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
435
484
  end
436
485
 
437
486
  data('regexp' => 'regexp', 'string' => 'string')
@@ -447,7 +496,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
447
496
  assert_equal(event_time("Feb 28 12:00:00", format: '%b %d %M:%S:%H'), time)
448
497
  assert_equal(@expected.merge('pri' => 6), record)
449
498
  end
450
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
451
499
  end
452
500
 
453
501
  data('regexp' => 'regexp', 'string' => 'string')
@@ -467,7 +515,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
467
515
  assert_equal 16, record["pri"]
468
516
  assert_equal "Hi, from Fluentd!", record["message"]
469
517
  end
470
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
471
518
  end
472
519
 
473
520
  data('regexp' => 'regexp', 'string' => 'string')
@@ -487,7 +534,7 @@ class SyslogParserTest < ::Test::Unit::TestCase
487
534
  record["extradata"]
488
535
  assert_equal "Hi, from Fluentd!", record["message"]
489
536
  end
490
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])end
537
+ end
491
538
 
492
539
  data('regexp' => 'regexp', 'string' => 'string')
493
540
  def test_parse_with_both_message_type(param)
@@ -503,7 +550,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
503
550
  assert_equal(event_time("Feb 28 12:00:00", format: '%b %d %M:%S:%H'), time)
504
551
  assert_equal(@expected.merge('pri' => 1), record)
505
552
  end
506
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
507
553
 
508
554
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] Hi, from Fluentd!'
509
555
  @parser.instance.parse(text) do |time, record|
@@ -514,21 +560,18 @@ class SyslogParserTest < ::Test::Unit::TestCase
514
560
  record["extradata"]
515
561
  assert_equal "Hi, from Fluentd!", record["message"]
516
562
  end
517
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
518
563
 
519
564
  text = '<1>Feb 28 12:00:02 192.168.0.1 fluentd[11111]: [error] Syslog test 2>1'
520
565
  @parser.instance.parse(text) do |time, record|
521
566
  assert_equal(event_time("Feb 28 12:00:02", format: '%b %d %M:%S:%H'), time)
522
567
  assert_equal(@expected.merge('pri' => 1, 'message'=> '[error] Syslog test 2>1'), record)
523
568
  end
524
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
525
569
 
526
570
  text = '<1>Feb 28 12:00:02 192.168.0.1 fluentd[11111]: [error] Syslog test'
527
571
  @parser.instance.parse(text) do |time, record|
528
572
  assert_equal(event_time("Feb 28 12:00:02", format: '%b %d %M:%S:%H'), time)
529
573
  assert_equal(@expected.merge('pri' => 1), record)
530
574
  end
531
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
532
575
 
533
576
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
534
577
  @parser.instance.parse(text) do |time, record|
@@ -538,7 +581,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
538
581
  assert_equal "-", record["extradata"]
539
582
  assert_equal "Hi, from Fluentd!", record["message"]
540
583
  end
541
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
542
584
  end
543
585
 
544
586
  data('regexp' => 'regexp', 'string' => 'string')
@@ -555,7 +597,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
555
597
  assert_equal(event_time("Feb 28 12:00:00", format: '%b %d %M:%S:%H'), time)
556
598
  assert_equal(@expected.merge('pri' => 6), record)
557
599
  end
558
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
559
600
 
560
601
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd 11111 ID24224 [exampleSDID@20224 iut="3" eventSource="Application" eventID="11211"] Hi, from Fluentd!'
561
602
  @parser.instance.parse(text) do |time, record|
@@ -566,14 +607,12 @@ class SyslogParserTest < ::Test::Unit::TestCase
566
607
  record["extradata"]
567
608
  assert_equal "Hi, from Fluentd!", record["message"]
568
609
  end
569
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
570
610
 
571
611
  text = '<16>Feb 28 12:00:02 192.168.0.1 fluentd[11111]: [error] Syslog test'
572
612
  @parser.instance.parse(text) do |time, record|
573
613
  assert_equal(event_time("Feb 28 12:00:02", format: '%b %d %M:%S:%H'), time)
574
614
  assert_equal(@expected.merge('pri' => 16), record)
575
615
  end
576
- assert_equal(Fluent::Plugin::SyslogParser::RFC3164_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
577
616
 
578
617
  text = '<16>1 2017-02-06T13:14:15.003Z 192.168.0.1 fluentd - - - Hi, from Fluentd!'
579
618
  @parser.instance.parse(text) do |time, record|
@@ -583,7 +622,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
583
622
  assert_equal "-", record["extradata"]
584
623
  assert_equal "Hi, from Fluentd!", record["message"]
585
624
  end
586
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
587
625
 
588
626
  text = '<16>1 2017-02-06T13:14:15Z 192.168.0.1 fluentd - - - Hi, from Fluentd without subseconds!'
589
627
  @parser.instance.parse(text) do |time, record|
@@ -593,7 +631,6 @@ class SyslogParserTest < ::Test::Unit::TestCase
593
631
  assert_equal "-", record["extradata"]
594
632
  assert_equal "Hi, from Fluentd without subseconds!", record["message"]
595
633
  end
596
- assert_equal(Fluent::Plugin::SyslogParser::RFC5424_WITHOUT_TIME_AND_PRI_REGEXP, @parser.instance.patterns['format'])
597
634
  end
598
635
  end
599
636
  end
@@ -0,0 +1,27 @@
1
+ -----BEGIN RSA PRIVATE KEY-----
2
+ MIIEpAIBAAKCAQEA21in8qRqBrfYlRHr1N6eGq3d4CnKe+lTt0sGbab1670s0+h1
3
+ lGtjWny6gLSnt5PBY36CUoFB8MtRciVG2zUhB+dAZe4Mst5dzJO6cONT/l/USbCV
4
+ rQ/x8m3YzeJNj89fCZ7/7po8CpEfn16BMAd6TMXZZ8O+DCgv3SliEyxpi9CLg2PK
5
+ wAV4lwktbGenYadWLFWjv5a+QElFGH/tu5jUDhggoisoQGyZCls2Vmbr6RH+uiy8
6
+ js3gxy+5YgbuwkrQtjbfwxe5yEsd6RgzO8oLqlowCwCrn4CNaXFwaZa/vqcWzY4L
7
+ qiEWLfmFpFcSZdoWjr1WHsJS/PM3AyJea8nAnQIDAQABAoIBAGkMpaqsmWbMR7rl
8
+ EVgqoffPCzMfcK01ivV+xf5f9ulG+aAndaB2aefdUojvfF+MMRNQdGPFKeqDxWbw
9
+ eWXkpQQe+ZWXk5darfubSLBl/0UVahs8qgJvX4WmnC3GUzUrsK1v68y/K0A4TrfJ
10
+ z/9LpYP9QWjTs0IpQPsfpavfGlFt1TJvPxmomn7D+n0N6zzD3kFlGdeCSYwtPURR
11
+ dJ7ifX2vU4E8UtSm7gLrXlmAl1O7bJjFvL3+QlzKDM4M1WJpA9MkmM2icKxdYpew
12
+ biRmIiUHdV4soad2Aq58v4q5UgdMqGI8f+fWPO9qgXN7AKbT9NkXr1w/pziOt5rq
13
+ /77lbKECgYEA9bmOSA1LfRRclJCaoWWu4PiaXdvMHvsNC9r8NUGuwmiosEMKHFEJ
14
+ z8wvzVXprziXAwDTwqkPJmKseNPC8WCq2GfNu7lqJ1V1wHxpzHKhiAWhs7rE7skW
15
+ mF2xn2Tocba/L3Nb+K0tXhOZ7daduz94YXFhmRtsutZ9JvFv3G+QmHkCgYEA5IS4
16
+ +cOFyha486U9jXyLcPmZXZY9ql4ILuKuQ5pHA7CBO/zU2behuwcainW6P0WzbhKs
17
+ CP8xR5W/otqcaHZxy6hg9/nUFVVZIR/0jgKyxCqJA1W49jt23gykmU6q0vj7haZJ
18
+ QMhcAbleHBC7YvYoMTpTMe7tZP4YsFNysBn76EUCgYBqtFAn07YjM7NcREsRqSE+
19
+ ylXmSisijOxGaKq6ybIE9APEvufmEf7LwKRFa3hVwaI6CKLsVhOhHJo+wd5WiR7H
20
+ aJQ7X7HMMN04YA5lXKXudluYu5MHCkWIlq8qQ1x4/N2a0mJu42ze/G4MjPTjuhUh
21
+ Y2X5YaJepAOm5JMpyzykKQKBgQDj9eaU+dBgLdSo8UD7ALAVrlio/HRdnNoq82SF
22
+ +cQ30P7KucgXvFDxQv/d+d0mu0BoYOYPP4uIbsEyE0SODQIt+LVrCmTgNzjni3op
23
+ pFVyzT/K/Nu7fsxwbEpSySAtv8UhqSVQI89sxN81vhdAfHDR0u4lVMSqx7QXSdeS
24
+ Bwm9xQKBgQDSeoHoXbmiqRBss9Em69JPwWRZOc9eLns+fFJ1x/WkhY4bnnVXTYkZ
25
+ LzRN4ICq18xHy8egbl93uxDcjkMxi3Wj64QZcygI9gWmDBW2hdMpEArR/grsM/FH
26
+ DYu9KUMhm5T1KtXtV3izSVCprthdGjbKSbmR6hGw3n9Z1uP6V1rnXQ==
27
+ -----END RSA PRIVATE KEY-----