fluentd 0.14.2 → 0.14.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/ChangeLog +77 -1131
  3. data/Rakefile +15 -0
  4. data/appveyor.yml +2 -2
  5. data/example/in_forward.conf +3 -0
  6. data/example/in_forward_client.conf +37 -0
  7. data/example/in_forward_shared_key.conf +15 -0
  8. data/example/in_forward_users.conf +24 -0
  9. data/example/multi_filters.conf +61 -0
  10. data/example/out_forward.conf +13 -13
  11. data/example/out_forward_client.conf +109 -0
  12. data/example/out_forward_shared_key.conf +36 -0
  13. data/example/out_forward_users.conf +65 -0
  14. data/example/{out_buffered_null.conf → out_null.conf} +10 -6
  15. data/example/secondary_file.conf +41 -0
  16. data/fluentd.gemspec +19 -16
  17. data/lib/fluent/agent.rb +5 -0
  18. data/lib/fluent/command/debug.rb +4 -4
  19. data/lib/fluent/compat/handle_tag_and_time_mixin.rb +2 -0
  20. data/lib/fluent/compat/output.rb +5 -2
  21. data/lib/fluent/config/configure_proxy.rb +26 -5
  22. data/lib/fluent/config/error.rb +3 -0
  23. data/lib/fluent/config/section.rb +15 -0
  24. data/lib/fluent/event_router.rb +77 -4
  25. data/lib/fluent/plugin/base.rb +12 -3
  26. data/lib/fluent/plugin/buffer.rb +5 -1
  27. data/lib/fluent/plugin/filter.rb +48 -6
  28. data/lib/fluent/plugin/filter_record_transformer.rb +3 -1
  29. data/lib/fluent/plugin/filter_stdout.rb +0 -4
  30. data/lib/fluent/plugin/in_debug_agent.rb +5 -5
  31. data/lib/fluent/plugin/in_dummy.rb +9 -1
  32. data/lib/fluent/plugin/in_forward.rb +330 -62
  33. data/lib/fluent/plugin/in_monitor_agent.rb +31 -77
  34. data/lib/fluent/plugin/in_tail.rb +76 -92
  35. data/lib/fluent/plugin/multi_output.rb +4 -0
  36. data/lib/fluent/plugin/out_forward.rb +328 -222
  37. data/lib/fluent/plugin/out_null.rb +37 -0
  38. data/lib/fluent/plugin/out_secondary_file.rb +128 -0
  39. data/lib/fluent/plugin/out_stdout.rb +38 -2
  40. data/lib/fluent/plugin/output.rb +29 -6
  41. data/lib/fluent/plugin/storage_local.rb +16 -0
  42. data/lib/fluent/plugin_helper/timer.rb +6 -1
  43. data/lib/fluent/root_agent.rb +4 -1
  44. data/lib/fluent/supervisor.rb +62 -9
  45. data/lib/fluent/test/base.rb +3 -0
  46. data/lib/fluent/test/driver/base.rb +5 -0
  47. data/lib/fluent/test/formatter_test.rb +2 -0
  48. data/lib/fluent/test/parser_test.rb +2 -0
  49. data/lib/fluent/test/startup_shutdown.rb +33 -0
  50. data/lib/fluent/version.rb +1 -1
  51. data/lib/fluent/winsvc.rb +1 -2
  52. data/test/compat/test_calls_super.rb +2 -0
  53. data/test/config/test_configurable.rb +88 -0
  54. data/test/config/test_types.rb +7 -3
  55. data/test/plugin/test_filter.rb +121 -23
  56. data/test/plugin/test_filter_record_transformer.rb +22 -6
  57. data/test/plugin/test_in_debug_agent.rb +2 -2
  58. data/test/plugin/test_in_forward.rb +920 -407
  59. data/test/plugin/test_in_monitor_agent.rb +333 -0
  60. data/test/plugin/test_in_tail.rb +686 -595
  61. data/test/plugin/test_out_forward.rb +150 -207
  62. data/test/plugin/test_out_null.rb +85 -9
  63. data/test/plugin/test_out_secondary_file.rb +432 -0
  64. data/test/plugin/test_out_stdout.rb +143 -45
  65. data/test/plugin/test_output.rb +53 -0
  66. data/test/plugin/test_output_as_buffered.rb +13 -0
  67. data/test/plugin/test_output_as_buffered_overflow.rb +3 -0
  68. data/test/plugin/test_output_as_buffered_retries.rb +11 -0
  69. data/test/plugin/test_output_as_buffered_secondary.rb +12 -0
  70. data/test/plugin/test_output_as_standard.rb +12 -0
  71. data/test/plugin_helper/test_compat_parameters.rb +2 -0
  72. data/test/plugin_helper/test_timer.rb +31 -0
  73. data/test/test_event_router.rb +87 -0
  74. data/test/test_filter.rb +48 -6
  75. data/test/test_log.rb +5 -2
  76. data/test/test_output.rb +41 -1
  77. data/test/test_plugin_classes.rb +17 -9
  78. data/test/test_root_agent.rb +188 -0
  79. metadata +62 -68
  80. data/lib/fluent/plugin/out_buffered_null.rb +0 -59
  81. data/lib/fluent/plugin/out_buffered_stdout.rb +0 -70
  82. data/test/plugin/test_out_buffered_null.rb +0 -79
  83. data/test/plugin/test_out_buffered_stdout.rb +0 -122
@@ -1,122 +0,0 @@
1
- require_relative '../helper'
2
- require 'fluent/test/driver/output'
3
- require 'fluent/plugin/out_buffered_stdout'
4
-
5
- class BufferedStdoutOutputTest < Test::Unit::TestCase
6
- def setup
7
- Fluent::Test.setup
8
- end
9
-
10
- CONFIG = %[
11
- ]
12
-
13
- def create_driver(conf = CONFIG)
14
- Fluent::Test::Driver::Output.new(Fluent::Plugin::BufferedStdoutOutput).configure(conf)
15
- end
16
-
17
- test 'default configure' do
18
- d = create_driver
19
- assert_equal [], d.instance.formatter_configs
20
- assert_equal 10 * 1024, d.instance.buffer_config.chunk_limit_size
21
- assert d.instance.buffer_config.flush_at_shutdown
22
- assert_equal ['tag'], d.instance.buffer_config.chunk_keys
23
- assert d.instance.chunk_key_tag
24
- assert !d.instance.chunk_key_time
25
- assert_equal [], d.instance.chunk_keys
26
- end
27
-
28
- test 'configure with output_type' do
29
- d = create_driver(CONFIG + "\noutput_type json")
30
- assert_equal 'json', d.instance.formatter_configs.first[:@type]
31
-
32
- d = create_driver(CONFIG + "\noutput_type hash")
33
- assert_equal 'hash', d.instance.formatter_configs.first[:@type]
34
-
35
- assert_raise(Fluent::ConfigError) do
36
- d = create_driver(CONFIG + "\noutput_type foo")
37
- end
38
- end
39
-
40
- sub_test_case "emit with default config" do
41
- test '#write(synchronous)' do
42
- d = create_driver
43
- time = event_time()
44
-
45
- out = capture_log do
46
- d.run(default_tag: 'test', flush: true) do
47
- d.feed(time, {'test' => 'test'})
48
- end
49
- end
50
- assert_equal "#{Time.at(time).localtime} test: {\"test\":\"test\"}\n", out
51
- end
52
- end
53
-
54
- sub_test_case "emit json" do
55
- data('oj' => 'oj', 'yajl' => 'yajl')
56
- test '#write(synchronous)' do |data|
57
- d = create_driver(CONFIG + "\noutput_type json\njson_parser #{data}")
58
- time = event_time()
59
-
60
- out = capture_log do
61
- d.run(default_tag: 'test', flush: true) do
62
- d.feed(time, {'test' => 'test'})
63
- end
64
- end
65
- assert_equal "#{Time.at(time).localtime} test: {\"test\":\"test\"}\n", out
66
- end
67
-
68
- data('oj' => 'oj', 'yajl' => 'yajl')
69
- test '#try_write(asynchronous)' do |data|
70
- d = create_driver(CONFIG + "\noutput_type json\njson_parser #{data}")
71
- time = event_time()
72
- d.instance.delayed = true
73
-
74
- out = capture_log do
75
- d.run(default_tag: 'test', flush: true, shutdown: false) do
76
- d.feed(time, {'test' => 'test'})
77
- end
78
- end
79
-
80
- assert_equal "#{Time.at(time).localtime} test: {\"test\":\"test\"}\n", out
81
- end
82
- end
83
-
84
- sub_test_case 'emit hash' do
85
- test '#write(synchronous)' do
86
- d = create_driver(CONFIG + "\noutput_type hash")
87
- time = event_time()
88
-
89
- out = capture_log do
90
- d.run(default_tag: 'test', flush: true) do
91
- d.feed(time, {'test' => 'test'})
92
- end
93
- end
94
-
95
- assert_equal "#{Time.at(time).localtime} test: {\"test\"=>\"test\"}\n", out
96
- end
97
-
98
- test '#try_write(asynchronous)' do
99
- d = create_driver(CONFIG + "\noutput_type hash")
100
- time = event_time()
101
- d.instance.delayed = true
102
-
103
- out = capture_log do
104
- d.run(default_tag: 'test', flush: true, shutdown: false) do
105
- d.feed(time, {'test' => 'test'})
106
- end
107
- end
108
-
109
- assert_equal "#{Time.at(time).localtime} test: {\"test\"=>\"test\"}\n", out
110
- end
111
- end
112
-
113
- # Capture the log output of the block given
114
- def capture_log(&block)
115
- tmp = $log
116
- $log = StringIO.new
117
- yield
118
- return $log.string
119
- ensure
120
- $log = tmp
121
- end
122
- end