fluentd 0.14.0 → 0.14.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 (105) hide show
  1. checksums.yaml +4 -4
  2. data/example/copy_roundrobin.conf +39 -0
  3. data/example/filter_stdout.conf +5 -5
  4. data/example/in_forward.conf +2 -2
  5. data/example/in_http.conf +2 -2
  6. data/example/in_syslog.conf +2 -2
  7. data/example/in_tail.conf +2 -2
  8. data/example/in_tcp.conf +2 -2
  9. data/example/in_udp.conf +2 -2
  10. data/example/out_buffered_null.conf +32 -0
  11. data/example/out_copy.conf +4 -4
  12. data/example/out_file.conf +2 -2
  13. data/example/out_forward.conf +2 -2
  14. data/example/v0_12_filter.conf +8 -8
  15. data/fluentd.gemspec +1 -1
  16. data/lib/fluent/command/fluentd.rb +6 -1
  17. data/lib/fluent/compat/handle_tag_name_mixin.rb +53 -0
  18. data/lib/fluent/compat/input.rb +1 -0
  19. data/lib/fluent/compat/output.rb +1 -0
  20. data/lib/fluent/compat/record_filter_mixin.rb +34 -0
  21. data/lib/fluent/compat/set_tag_key_mixin.rb +50 -0
  22. data/lib/fluent/compat/set_time_key_mixin.rb +69 -0
  23. data/lib/fluent/compat/type_converter.rb +90 -0
  24. data/lib/fluent/config/configure_proxy.rb +24 -4
  25. data/lib/fluent/config/dsl.rb +18 -1
  26. data/lib/fluent/config/v1_parser.rb +3 -2
  27. data/lib/fluent/configurable.rb +1 -1
  28. data/lib/fluent/event.rb +37 -9
  29. data/lib/fluent/mixin.rb +12 -286
  30. data/lib/fluent/plugin/buffer.rb +2 -2
  31. data/lib/fluent/plugin/in_dummy.rb +5 -1
  32. data/lib/fluent/plugin/in_gc_stat.rb +7 -37
  33. data/lib/fluent/plugin/in_http.rb +2 -0
  34. data/lib/fluent/plugin/{in_stream.rb → in_unix.rb} +0 -0
  35. data/lib/fluent/plugin/out_buffered_stdout.rb +60 -0
  36. data/lib/fluent/plugin/out_copy.rb +8 -51
  37. data/lib/fluent/plugin/out_null.rb +5 -5
  38. data/lib/fluent/plugin/out_relabel.rb +5 -5
  39. data/lib/fluent/plugin/out_roundrobin.rb +13 -40
  40. data/lib/fluent/plugin/output.rb +9 -0
  41. data/lib/fluent/plugin_helper.rb +2 -0
  42. data/lib/fluent/plugin_helper/formatter.rb +138 -0
  43. data/lib/fluent/plugin_helper/inject.rb +112 -0
  44. data/lib/fluent/plugin_helper/parser.rb +138 -0
  45. data/lib/fluent/plugin_helper/storage.rb +64 -50
  46. data/lib/fluent/process.rb +6 -1
  47. data/lib/fluent/registry.rb +1 -1
  48. data/lib/fluent/supervisor.rb +20 -2
  49. data/lib/fluent/test.rb +30 -5
  50. data/lib/fluent/test/base.rb +2 -66
  51. data/lib/fluent/test/driver/base.rb +3 -0
  52. data/lib/fluent/test/driver/base_owned.rb +106 -0
  53. data/lib/fluent/test/driver/formatter.rb +30 -0
  54. data/lib/fluent/test/driver/multi_output.rb +52 -0
  55. data/lib/fluent/test/driver/owner.rb +32 -0
  56. data/lib/fluent/test/driver/parser.rb +30 -0
  57. data/lib/fluent/test/helpers.rb +54 -0
  58. data/lib/fluent/test/log.rb +73 -0
  59. data/lib/fluent/time.rb +71 -0
  60. data/lib/fluent/version.rb +1 -1
  61. data/test/compat/test_parser.rb +82 -0
  62. data/test/config/test_configure_proxy.rb +15 -0
  63. data/test/config/test_dsl.rb +180 -2
  64. data/test/helper.rb +2 -24
  65. data/test/plugin/test_in_gc_stat.rb +6 -6
  66. data/test/plugin/test_in_http.rb +49 -32
  67. data/test/plugin/{test_in_stream.rb → test_in_unix.rb} +1 -1
  68. data/test/plugin/test_out_buffered_stdout.rb +108 -0
  69. data/test/plugin/test_out_copy.rb +88 -127
  70. data/test/plugin/test_out_null.rb +29 -0
  71. data/test/plugin/test_out_relabel.rb +28 -0
  72. data/test/plugin/test_out_roundrobin.rb +35 -29
  73. data/test/plugin/test_out_stdout.rb +4 -4
  74. data/test/plugin/test_output_as_buffered.rb +51 -0
  75. data/test/plugin/test_output_as_buffered_secondary.rb +13 -0
  76. data/test/plugin/test_parser_apache.rb +38 -0
  77. data/test/plugin/test_parser_apache2.rb +38 -0
  78. data/test/plugin/test_parser_apache_error.rb +40 -0
  79. data/test/plugin/test_parser_base.rb +32 -0
  80. data/test/plugin/test_parser_csv.rb +94 -0
  81. data/test/plugin/test_parser_json.rb +107 -0
  82. data/test/plugin/test_parser_labeled_tsv.rb +129 -0
  83. data/test/plugin/test_parser_multiline.rb +100 -0
  84. data/test/plugin/test_parser_nginx.rb +42 -0
  85. data/test/plugin/test_parser_none.rb +53 -0
  86. data/test/plugin/test_parser_regexp.rb +110 -0
  87. data/test/plugin/test_parser_syslog.rb +66 -0
  88. data/test/plugin/test_parser_time.rb +46 -0
  89. data/test/plugin/test_parser_tsv.rb +125 -0
  90. data/test/plugin_helper/test_child_process.rb +11 -2
  91. data/test/plugin_helper/test_formatter.rb +212 -0
  92. data/test/plugin_helper/test_inject.rb +388 -0
  93. data/test/plugin_helper/test_parser.rb +223 -0
  94. data/test/plugin_helper/test_retry_state.rb +40 -40
  95. data/test/plugin_helper/test_storage.rb +77 -10
  96. data/test/scripts/fluent/plugin/out_test.rb +22 -17
  97. data/test/scripts/fluent/plugin/out_test2.rb +80 -0
  98. data/test/test_event.rb +57 -0
  99. data/test/test_formatter.rb +0 -178
  100. data/test/test_output.rb +2 -152
  101. data/test/test_root_agent.rb +3 -2
  102. data/test/test_supervisor.rb +93 -26
  103. data/test/test_time_formatter.rb +186 -0
  104. metadata +69 -7
  105. data/test/test_parser.rb +0 -1087
@@ -77,7 +77,7 @@ class RootAgentTest < ::Test::Unit::TestCase
77
77
  EOC
78
78
  ra = configure_ra(conf)
79
79
  assert_kind_of FluentTestInput, ra.inputs.first
80
- assert_kind_of RelabelOutput, ra.outputs.first
80
+ assert_kind_of Plugin::RelabelOutput, ra.outputs.first
81
81
  assert_kind_of FluentTestFilter, ra.filters.first
82
82
  assert ra.error_collector
83
83
 
@@ -91,7 +91,7 @@ EOC
91
91
  assert_equal ra, test_label.root_agent
92
92
 
93
93
  error_label = ra.labels['@ERROR']
94
- assert_kind_of NullOutput, error_label.outputs.first
94
+ assert_kind_of Fluent::Plugin::NullOutput, error_label.outputs.first
95
95
  assert_kind_of RootAgent::RootAgentProxyWithoutErrorCollector, error_label.root_agent
96
96
  end
97
97
  end
@@ -99,6 +99,7 @@ EOC
99
99
  sub_test_case 'start/shutdown' do
100
100
  setup do
101
101
  @ra = RootAgent.new(log: $log)
102
+ stub(Engine).root_agent { @ra }
102
103
  @ra.configure(Config.parse(<<-EOC, "(test)", "(test_dir)", true))
103
104
  <source>
104
105
  @type test_in
@@ -61,13 +61,13 @@ class SupervisorTest < ::Test::Unit::TestCase
61
61
  conf = sv.instance_variable_get(:@conf)
62
62
 
63
63
  elem = conf.elements.find { |e| e.name == 'source' }
64
- assert_equal elem['@type'], "forward"
65
- assert_equal elem['@id'], "forward_input"
64
+ assert_equal "forward", elem['@type']
65
+ assert_equal "forward_input", elem['@id']
66
66
 
67
67
  elem = conf.elements.find { |e| e.name == 'match' }
68
- assert_equal elem.arg, "debug.**"
69
- assert_equal elem['@type'], "stdout"
70
- assert_equal elem['@id'], "stdout_output"
68
+ assert_equal "debug.**", elem.arg
69
+ assert_equal "stdout", elem['@type']
70
+ assert_equal "stdout_output", elem['@id']
71
71
 
72
72
  $log.out.reset
73
73
  end
@@ -91,13 +91,13 @@ class SupervisorTest < ::Test::Unit::TestCase
91
91
  sv.send(:set_system_config)
92
92
  sys_conf = sv.instance_variable_get(:@system_config)
93
93
 
94
- assert_equal sys_conf.rpc_endpoint, '127.0.0.1:24445'
95
- assert_equal sys_conf.suppress_repeated_stacktrace, true
96
- assert_equal sys_conf.suppress_config_dump, true
97
- assert_equal sys_conf.without_source, true
98
- assert_equal sys_conf.enable_get_dump, true
99
- assert_equal sys_conf.process_name, "process_name"
100
- assert_equal sys_conf.log_level, 2
94
+ assert_equal '127.0.0.1:24445', sys_conf.rpc_endpoint
95
+ assert_equal true, sys_conf.suppress_repeated_stacktrace
96
+ assert_equal true, sys_conf.suppress_config_dump
97
+ assert_equal true, sys_conf.without_source
98
+ assert_equal true, sys_conf.enable_get_dump
99
+ assert_equal "process_name", sys_conf.process_name
100
+ assert_equal 2, sys_conf.log_level
101
101
  end
102
102
 
103
103
  def test_main_process_signal_handlers
@@ -201,15 +201,17 @@ class SupervisorTest < ::Test::Unit::TestCase
201
201
 
202
202
  # first call
203
203
  se_config = load_config_proc.call
204
- assert_equal se_config[:log_level], Fluent::Log::LEVEL_INFO
205
- assert_equal se_config[:suppress_repeated_stacktrace], true
206
- assert_equal se_config[:worker_type], 'spawn'
207
- assert_equal se_config[:workers], 1
208
- assert_equal se_config[:log_stdin], false
209
- assert_equal se_config[:log_stdout], false
210
- assert_equal se_config[:log_stderr], false
211
- assert_equal se_config[:enable_heartbeat], true
212
- assert_equal se_config[:auto_heartbeat], false
204
+ assert_equal Fluent::Log::LEVEL_INFO, se_config[:log_level]
205
+ assert_equal true, se_config[:suppress_repeated_stacktrace]
206
+ assert_equal 'spawn', se_config[:worker_type]
207
+ assert_equal 1, se_config[:workers]
208
+ assert_equal false, se_config[:log_stdin]
209
+ assert_equal false, se_config[:log_stdout]
210
+ assert_equal false, se_config[:log_stderr]
211
+ assert_equal true, se_config[:enable_heartbeat]
212
+ assert_equal false, se_config[:auto_heartbeat]
213
+ assert_equal false, se_config[:daemonize]
214
+ assert_nil se_config[:pid_path]
213
215
 
214
216
  # second call immediately(reuse config)
215
217
  se_config = load_config_proc.call
@@ -230,14 +232,79 @@ class SupervisorTest < ::Test::Unit::TestCase
230
232
  # forth call immediately(reuse config)
231
233
  se_config = load_config_proc.call
232
234
  # test that pre_config_mtime and pre_loadtime are not changed from previous one because reused pre_config
233
- assert_equal se_config[:windows_daemon_cmdline][5]['pre_config_mtime'], pre_config_mtime
234
- assert_equal se_config[:windows_daemon_cmdline][5]['pre_loadtime'], pre_loadtime
235
+ assert_equal pre_config_mtime, se_config[:windows_daemon_cmdline][5]['pre_config_mtime']
236
+ assert_equal pre_loadtime, se_config[:windows_daemon_cmdline][5]['pre_loadtime']
235
237
 
236
238
  write_config tmp_dir, conf_debug_str
237
239
 
238
240
  # fifth call after changed conf file(don't reuse config)
239
241
  se_config = load_config_proc.call
240
- assert_equal se_config[:log_level], Fluent::Log::LEVEL_DEBUG
242
+ assert_equal Fluent::Log::LEVEL_DEBUG, se_config[:log_level]
243
+ end
244
+
245
+ def test_load_config_for_daemonize
246
+ tmp_dir = "#{TMP_DIR}/dir/test_load_config.conf"
247
+ conf_info_str = %[
248
+ <system>
249
+ log_level info
250
+ </system>
251
+ ]
252
+ conf_debug_str = %[
253
+ <system>
254
+ log_level debug
255
+ </system>
256
+ ]
257
+ write_config tmp_dir, conf_info_str
258
+
259
+ params = {}
260
+ params['use_v1_config'] = true
261
+ params['log_path'] = 'test/tmp/supervisor/log'
262
+ params['suppress_repeated_stacktrace'] = true
263
+ params['log_level'] = Fluent::Log::LEVEL_INFO
264
+ params['daemonize'] = './fluentd.pid'
265
+ load_config_proc = Proc.new { Fluent::Supervisor.load_config(tmp_dir, params) }
266
+
267
+ # first call
268
+ se_config = load_config_proc.call
269
+ assert_equal Fluent::Log::LEVEL_INFO, se_config[:log_level]
270
+ assert_equal true, se_config[:suppress_repeated_stacktrace]
271
+ assert_equal 'spawn', se_config[:worker_type]
272
+ assert_equal 1, se_config[:workers]
273
+ assert_equal false, se_config[:log_stdin]
274
+ assert_equal false, se_config[:log_stdout]
275
+ assert_equal false, se_config[:log_stderr]
276
+ assert_equal true, se_config[:enable_heartbeat]
277
+ assert_equal false, se_config[:auto_heartbeat]
278
+ assert_equal true, se_config[:daemonize]
279
+ assert_equal './fluentd.pid', se_config[:pid_path]
280
+
281
+ # second call immediately(reuse config)
282
+ se_config = load_config_proc.call
283
+ pre_config_mtime = se_config[:windows_daemon_cmdline][5]['pre_config_mtime']
284
+ pre_loadtime = se_config[:windows_daemon_cmdline][5]['pre_loadtime']
285
+ assert_nil pre_config_mtime
286
+ assert_nil pre_loadtime
287
+
288
+ sleep 5
289
+
290
+ # third call after 5 seconds(don't reuse config)
291
+ se_config = load_config_proc.call
292
+ pre_config_mtime = se_config[:windows_daemon_cmdline][5]['pre_config_mtime']
293
+ pre_loadtime = se_config[:windows_daemon_cmdline][5]['pre_loadtime']
294
+ assert_not_nil pre_config_mtime
295
+ assert_not_nil pre_loadtime
296
+
297
+ # forth call immediately(reuse config)
298
+ se_config = load_config_proc.call
299
+ # test that pre_config_mtime and pre_loadtime are not changed from previous one because reused pre_config
300
+ assert_equal pre_config_mtime, se_config[:windows_daemon_cmdline][5]['pre_config_mtime']
301
+ assert_equal pre_loadtime, se_config[:windows_daemon_cmdline][5]['pre_loadtime']
302
+
303
+ write_config tmp_dir, conf_debug_str
304
+
305
+ # fifth call after changed conf file(don't reuse config)
306
+ se_config = load_config_proc.call
307
+ assert_equal Fluent::Log::LEVEL_DEBUG, se_config[:log_level]
241
308
  end
242
309
 
243
310
  def test_logger
@@ -247,11 +314,11 @@ class SupervisorTest < ::Test::Unit::TestCase
247
314
  log.init
248
315
  logger = $log.instance_variable_get(:@logger)
249
316
 
250
- assert_equal $log.level, Fluent::Log::LEVEL_INFO
317
+ assert_equal Fluent::Log::LEVEL_INFO, $log.level
251
318
 
252
319
  # test that DamonLogger#level= overwrites Fluent.log#level
253
320
  logger.level = 'debug'
254
- assert_equal $log.level, Fluent::Log::LEVEL_DEBUG
321
+ assert_equal Fluent::Log::LEVEL_DEBUG, $log.level
255
322
  end
256
323
 
257
324
  def create_debug_dummy_logger
@@ -0,0 +1,186 @@
1
+ require_relative 'helper'
2
+ require 'fluent/test'
3
+ require 'fluent/time'
4
+
5
+ class TimeFormatterTest < ::Test::Unit::TestCase
6
+ def with_timezone(tz)
7
+ oldtz, ENV['TZ'] = ENV['TZ'], tz
8
+ yield
9
+ ensure
10
+ ENV['TZ'] = oldtz
11
+ end
12
+
13
+ def setup
14
+ @time = Time.new(2014, 9, 27, 0, 0, 0, 0).to_i
15
+ @fmt = "%Y%m%d %H%M%z" # YYYYMMDD HHMM[+-]HHMM
16
+ end
17
+
18
+ def format(format, localtime, timezone)
19
+ formatter = Fluent::TimeFormatter.new(format, localtime, timezone)
20
+ formatter.format(@time)
21
+ end
22
+
23
+ def test_default_utc_nil
24
+ assert_equal("2014-09-27T00:00:00Z", format(nil, false, nil))
25
+ end
26
+
27
+ def test_default_utc_pHH_MM
28
+ assert_equal("2014-09-27T01:30:00+01:30", format(nil, false, "+01:30"))
29
+ end
30
+
31
+ def test_default_utc_nHH_MM
32
+ assert_equal("2014-09-26T22:30:00-01:30", format(nil, false, "-01:30"))
33
+ end
34
+
35
+ def test_default_utc_pHHMM
36
+ assert_equal("2014-09-27T02:30:00+02:30", format(nil, false, "+0230"))
37
+ end
38
+
39
+ def test_default_utc_nHHMM
40
+ assert_equal("2014-09-26T21:30:00-02:30", format(nil, false, "-0230"))
41
+ end
42
+
43
+ def test_default_utc_pHH
44
+ assert_equal("2014-09-27T03:00:00+03:00", format(nil, false, "+03"))
45
+ end
46
+
47
+ def test_default_utc_nHH
48
+ assert_equal("2014-09-26T21:00:00-03:00", format(nil, false, "-03"))
49
+ end
50
+
51
+ def test_default_utc_timezone_1
52
+ # Asia/Tokyo (+09:00) does not have daylight saving time.
53
+ assert_equal("2014-09-27T09:00:00+09:00", format(nil, false, "Asia/Tokyo"))
54
+ end
55
+
56
+ def test_default_utc_timezone_2
57
+ # Pacific/Honolulu (-10:00) does not have daylight saving time.
58
+ assert_equal("2014-09-26T14:00:00-10:00", format(nil, false, "Pacific/Honolulu"))
59
+ end
60
+
61
+ def test_default_utc_timezone_3
62
+ # America/Argentina/Buenos_Aires (-03:00) does not have daylight saving time.
63
+ assert_equal("2014-09-26T21:00:00-03:00", format(nil, false, "America/Argentina/Buenos_Aires"))
64
+ end
65
+
66
+ def test_default_utc_timezone_4
67
+ # Europe/Paris has daylight saving time. Its UTC offset is +01:00 and its
68
+ # UTC offset in DST is +02:00. In September, Europe/Paris is in DST.
69
+ assert_equal("2014-09-27T02:00:00+02:00", format(nil, false, "Europe/Paris"))
70
+ end
71
+
72
+ def test_default_utc_timezone_5
73
+ # Europe/Paris has daylight saving time. Its UTC offset is +01:00 and its
74
+ # UTC offset in DST is +02:00. In January, Europe/Paris is not in DST.
75
+ @time = Time.new(2014, 1, 24, 0, 0, 0, 0).to_i
76
+ assert_equal("2014-01-24T01:00:00+01:00", format(nil, false, "Europe/Paris"))
77
+ end
78
+
79
+ def test_default_utc_invalid
80
+ assert_equal("2014-09-27T00:00:00Z", format(nil, false, "Invalid"))
81
+ end
82
+
83
+ def test_default_localtime_nil_1
84
+ with_timezone("UTC-04") do
85
+ assert_equal("2014-09-27T04:00:00+04:00", format(nil, true, nil))
86
+ end
87
+ end
88
+
89
+ def test_default_localtime_nil_2
90
+ with_timezone("UTC+05") do
91
+ assert_equal("2014-09-26T19:00:00-05:00", format(nil, true, nil))
92
+ end
93
+ end
94
+
95
+ def test_default_localtime_timezone
96
+ # 'timezone' takes precedence over 'localtime'.
97
+ with_timezone("UTC-06") do
98
+ assert_equal("2014-09-27T07:00:00+07:00", format(nil, true, "+07"))
99
+ end
100
+ end
101
+
102
+ def test_specific_utc_nil
103
+ assert_equal("20140927 0000+0000", format(@fmt, false, nil))
104
+ end
105
+
106
+ def test_specific_utc_pHH_MM
107
+ assert_equal("20140927 0830+0830", format(@fmt, false, "+08:30"))
108
+ end
109
+
110
+ def test_specific_utc_nHH_MM
111
+ assert_equal("20140926 1430-0930", format(@fmt, false, "-09:30"))
112
+ end
113
+
114
+ def test_specific_utc_pHHMM
115
+ assert_equal("20140927 1030+1030", format(@fmt, false, "+1030"))
116
+ end
117
+
118
+ def test_specific_utc_nHHMM
119
+ assert_equal("20140926 1230-1130", format(@fmt, false, "-1130"))
120
+ end
121
+
122
+ def test_specific_utc_pHH
123
+ assert_equal("20140927 1200+1200", format(@fmt, false, "+12"))
124
+ end
125
+
126
+ def test_specific_utc_nHH
127
+ assert_equal("20140926 1100-1300", format(@fmt, false, "-13"))
128
+ end
129
+
130
+ def test_specific_utc_timezone_1
131
+ # Europe/Moscow (+04:00) does not have daylight saving time.
132
+ assert_equal("20140927 0400+0400", format(@fmt, false, "Europe/Moscow"))
133
+ end
134
+
135
+ def test_specific_utc_timezone_2
136
+ # Pacific/Galapagos (-06:00) does not have daylight saving time.
137
+ assert_equal("20140926 1800-0600", format(@fmt, false, "Pacific/Galapagos"))
138
+ end
139
+
140
+ def test_specific_utc_timezone_3
141
+ # America/Argentina/Buenos_Aires (-03:00) does not have daylight saving time.
142
+ assert_equal("20140926 2100-0300", format(@fmt, false, "America/Argentina/Buenos_Aires"))
143
+ end
144
+
145
+ def test_specific_utc_timezone_4
146
+ # America/Los_Angeles has daylight saving time. Its UTC offset is -08:00 and its
147
+ # UTC offset in DST is -07:00. In September, America/Los_Angeles is in DST.
148
+ assert_equal("20140926 1700-0700", format(@fmt, false, "America/Los_Angeles"))
149
+ end
150
+
151
+ def test_specific_utc_timezone_5
152
+ # America/Los_Angeles has daylight saving time. Its UTC offset is -08:00 and its
153
+ # UTC offset in DST is -07:00. In January, America/Los_Angeles is not in DST.
154
+ @time = Time.new(2014, 1, 24, 0, 0, 0, 0).to_i
155
+ assert_equal("20140123 1600-0800", format(@fmt, false, "America/Los_Angeles"))
156
+ end
157
+
158
+ def test_specific_utc_invalid
159
+ assert_equal("20140927 0000+0000", format(@fmt, false, "Invalid"))
160
+ end
161
+
162
+ def test_specific_localtime_nil_1
163
+ with_timezone("UTC-07") do
164
+ assert_equal("20140927 0700+0700", format(@fmt, true, nil))
165
+ end
166
+ end
167
+
168
+ def test_specific_localtime_nil_2
169
+ with_timezone("UTC+08") do
170
+ assert_equal("20140926 1600-0800", format(@fmt, true, nil))
171
+ end
172
+ end
173
+
174
+ def test_specific_localtime_timezone
175
+ # 'timezone' takes precedence over 'localtime'.
176
+ with_timezone("UTC-09") do
177
+ assert_equal("20140926 1400-1000", format(@fmt, true, "-10"))
178
+ end
179
+ end
180
+
181
+ def test_format_with_subsec
182
+ time = Fluent::EventTime.new(@time)
183
+ formatter = Fluent::TimeFormatter.new("%Y%m%d %H%M.%N", false, nil)
184
+ assert_equal("20140927 0000.000000000", formatter.format(time))
185
+ end
186
+ end
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: 0.14.0
4
+ version: 0.14.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sadayuki Furuhashi
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack
@@ -316,6 +316,7 @@ files:
316
316
  - bin/fluent-debug
317
317
  - bin/fluent-gem
318
318
  - bin/fluentd
319
+ - example/copy_roundrobin.conf
319
320
  - example/filter_stdout.conf
320
321
  - example/in_forward.conf
321
322
  - example/in_http.conf
@@ -324,6 +325,7 @@ files:
324
325
  - example/in_tail.conf
325
326
  - example/in_tcp.conf
326
327
  - example/in_udp.conf
328
+ - example/out_buffered_null.conf
327
329
  - example/out_copy.conf
328
330
  - example/out_file.conf
329
331
  - example/out_forward.conf
@@ -340,11 +342,16 @@ files:
340
342
  - lib/fluent/compat/call_super_mixin.rb
341
343
  - lib/fluent/compat/filter.rb
342
344
  - lib/fluent/compat/formatter.rb
345
+ - lib/fluent/compat/handle_tag_name_mixin.rb
343
346
  - lib/fluent/compat/input.rb
344
347
  - lib/fluent/compat/output.rb
345
348
  - lib/fluent/compat/output_chain.rb
346
349
  - lib/fluent/compat/parser.rb
347
350
  - lib/fluent/compat/propagate_default.rb
351
+ - lib/fluent/compat/record_filter_mixin.rb
352
+ - lib/fluent/compat/set_tag_key_mixin.rb
353
+ - lib/fluent/compat/set_time_key_mixin.rb
354
+ - lib/fluent/compat/type_converter.rb
348
355
  - lib/fluent/config.rb
349
356
  - lib/fluent/config/basic_parser.rb
350
357
  - lib/fluent/config/configure_proxy.rb
@@ -407,14 +414,15 @@ files:
407
414
  - lib/fluent/plugin/in_http.rb
408
415
  - lib/fluent/plugin/in_monitor_agent.rb
409
416
  - lib/fluent/plugin/in_object_space.rb
410
- - lib/fluent/plugin/in_stream.rb
411
417
  - lib/fluent/plugin/in_syslog.rb
412
418
  - lib/fluent/plugin/in_tail.rb
413
419
  - lib/fluent/plugin/in_tcp.rb
414
420
  - lib/fluent/plugin/in_udp.rb
421
+ - lib/fluent/plugin/in_unix.rb
415
422
  - lib/fluent/plugin/input.rb
416
423
  - lib/fluent/plugin/multi_output.rb
417
424
  - lib/fluent/plugin/out_buffered_null.rb
425
+ - lib/fluent/plugin/out_buffered_stdout.rb
418
426
  - lib/fluent/plugin/out_copy.rb
419
427
  - lib/fluent/plugin/out_exec.rb
420
428
  - lib/fluent/plugin/out_exec_filter.rb
@@ -448,6 +456,9 @@ files:
448
456
  - lib/fluent/plugin_helper/compat_parameters.rb
449
457
  - lib/fluent/plugin_helper/event_emitter.rb
450
458
  - lib/fluent/plugin_helper/event_loop.rb
459
+ - lib/fluent/plugin_helper/formatter.rb
460
+ - lib/fluent/plugin_helper/inject.rb
461
+ - lib/fluent/plugin_helper/parser.rb
451
462
  - lib/fluent/plugin_helper/retry_state.rb
452
463
  - lib/fluent/plugin_helper/storage.rb
453
464
  - lib/fluent/plugin_helper/thread.rb
@@ -462,14 +473,21 @@ files:
462
473
  - lib/fluent/test.rb
463
474
  - lib/fluent/test/base.rb
464
475
  - lib/fluent/test/driver/base.rb
476
+ - lib/fluent/test/driver/base_owned.rb
465
477
  - lib/fluent/test/driver/event_feeder.rb
466
478
  - lib/fluent/test/driver/filter.rb
479
+ - lib/fluent/test/driver/formatter.rb
467
480
  - lib/fluent/test/driver/input.rb
481
+ - lib/fluent/test/driver/multi_output.rb
468
482
  - lib/fluent/test/driver/output.rb
483
+ - lib/fluent/test/driver/owner.rb
484
+ - lib/fluent/test/driver/parser.rb
469
485
  - lib/fluent/test/driver/test_event_router.rb
470
486
  - lib/fluent/test/filter_test.rb
471
487
  - lib/fluent/test/formatter_test.rb
488
+ - lib/fluent/test/helpers.rb
472
489
  - lib/fluent/test/input_test.rb
490
+ - lib/fluent/test/log.rb
473
491
  - lib/fluent/test/output_test.rb
474
492
  - lib/fluent/test/parser_test.rb
475
493
  - lib/fluent/time.rb
@@ -478,6 +496,7 @@ files:
478
496
  - lib/fluent/version.rb
479
497
  - lib/fluent/winsvc.rb
480
498
  - test/compat/test_calls_super.rb
499
+ - test/compat/test_parser.rb
481
500
  - test/config/assertions.rb
482
501
  - test/config/test_config_parser.rb
483
502
  - test/config/test_configurable.rb
@@ -515,19 +534,22 @@ files:
515
534
  - test/plugin/test_in_gc_stat.rb
516
535
  - test/plugin/test_in_http.rb
517
536
  - test/plugin/test_in_object_space.rb
518
- - test/plugin/test_in_stream.rb
519
537
  - test/plugin/test_in_syslog.rb
520
538
  - test/plugin/test_in_tail.rb
521
539
  - test/plugin/test_in_tcp.rb
522
540
  - test/plugin/test_in_udp.rb
541
+ - test/plugin/test_in_unix.rb
523
542
  - test/plugin/test_input.rb
524
543
  - test/plugin/test_multi_output.rb
525
544
  - test/plugin/test_out_buffered_null.rb
545
+ - test/plugin/test_out_buffered_stdout.rb
526
546
  - test/plugin/test_out_copy.rb
527
547
  - test/plugin/test_out_exec.rb
528
548
  - test/plugin/test_out_exec_filter.rb
529
549
  - test/plugin/test_out_file.rb
530
550
  - test/plugin/test_out_forward.rb
551
+ - test/plugin/test_out_null.rb
552
+ - test/plugin/test_out_relabel.rb
531
553
  - test/plugin/test_out_roundrobin.rb
532
554
  - test/plugin/test_out_stdout.rb
533
555
  - test/plugin/test_out_stream.rb
@@ -538,6 +560,20 @@ files:
538
560
  - test/plugin/test_output_as_buffered_secondary.rb
539
561
  - test/plugin/test_output_as_standard.rb
540
562
  - test/plugin/test_owned_by.rb
563
+ - test/plugin/test_parser_apache.rb
564
+ - test/plugin/test_parser_apache2.rb
565
+ - test/plugin/test_parser_apache_error.rb
566
+ - test/plugin/test_parser_base.rb
567
+ - test/plugin/test_parser_csv.rb
568
+ - test/plugin/test_parser_json.rb
569
+ - test/plugin/test_parser_labeled_tsv.rb
570
+ - test/plugin/test_parser_multiline.rb
571
+ - test/plugin/test_parser_nginx.rb
572
+ - test/plugin/test_parser_none.rb
573
+ - test/plugin/test_parser_regexp.rb
574
+ - test/plugin/test_parser_syslog.rb
575
+ - test/plugin/test_parser_time.rb
576
+ - test/plugin/test_parser_tsv.rb
541
577
  - test/plugin/test_storage.rb
542
578
  - test/plugin/test_storage_local.rb
543
579
  - test/plugin/test_string_util.rb
@@ -545,6 +581,9 @@ files:
545
581
  - test/plugin_helper/test_compat_parameters.rb
546
582
  - test/plugin_helper/test_event_emitter.rb
547
583
  - test/plugin_helper/test_event_loop.rb
584
+ - test/plugin_helper/test_formatter.rb
585
+ - test/plugin_helper/test_inject.rb
586
+ - test/plugin_helper/test_parser.rb
548
587
  - test/plugin_helper/test_retry_state.rb
549
588
  - test/plugin_helper/test_storage.rb
550
589
  - test/plugin_helper/test_thread.rb
@@ -552,6 +591,7 @@ files:
552
591
  - test/scripts/exec_script.rb
553
592
  - test/scripts/fluent/plugin/formatter_known.rb
554
593
  - test/scripts/fluent/plugin/out_test.rb
594
+ - test/scripts/fluent/plugin/out_test2.rb
555
595
  - test/scripts/fluent/plugin/parser_known.rb
556
596
  - test/test_config.rb
557
597
  - test/test_configdsl.rb
@@ -565,12 +605,12 @@ files:
565
605
  - test/test_match.rb
566
606
  - test/test_mixin.rb
567
607
  - test/test_output.rb
568
- - test/test_parser.rb
569
608
  - test/test_plugin_classes.rb
570
609
  - test/test_plugin_helper.rb
571
610
  - test/test_process.rb
572
611
  - test/test_root_agent.rb
573
612
  - test/test_supervisor.rb
613
+ - test/test_time_formatter.rb
574
614
  - test/test_unique_id.rb
575
615
  homepage: http://fluentd.org/
576
616
  licenses:
@@ -598,6 +638,7 @@ specification_version: 4
598
638
  summary: Fluentd event collector
599
639
  test_files:
600
640
  - test/compat/test_calls_super.rb
641
+ - test/compat/test_parser.rb
601
642
  - test/config/assertions.rb
602
643
  - test/config/test_config_parser.rb
603
644
  - test/config/test_configurable.rb
@@ -635,19 +676,22 @@ test_files:
635
676
  - test/plugin/test_in_gc_stat.rb
636
677
  - test/plugin/test_in_http.rb
637
678
  - test/plugin/test_in_object_space.rb
638
- - test/plugin/test_in_stream.rb
639
679
  - test/plugin/test_in_syslog.rb
640
680
  - test/plugin/test_in_tail.rb
641
681
  - test/plugin/test_in_tcp.rb
642
682
  - test/plugin/test_in_udp.rb
683
+ - test/plugin/test_in_unix.rb
643
684
  - test/plugin/test_input.rb
644
685
  - test/plugin/test_multi_output.rb
645
686
  - test/plugin/test_out_buffered_null.rb
687
+ - test/plugin/test_out_buffered_stdout.rb
646
688
  - test/plugin/test_out_copy.rb
647
689
  - test/plugin/test_out_exec.rb
648
690
  - test/plugin/test_out_exec_filter.rb
649
691
  - test/plugin/test_out_file.rb
650
692
  - test/plugin/test_out_forward.rb
693
+ - test/plugin/test_out_null.rb
694
+ - test/plugin/test_out_relabel.rb
651
695
  - test/plugin/test_out_roundrobin.rb
652
696
  - test/plugin/test_out_stdout.rb
653
697
  - test/plugin/test_out_stream.rb
@@ -658,6 +702,20 @@ test_files:
658
702
  - test/plugin/test_output_as_buffered_secondary.rb
659
703
  - test/plugin/test_output_as_standard.rb
660
704
  - test/plugin/test_owned_by.rb
705
+ - test/plugin/test_parser_apache.rb
706
+ - test/plugin/test_parser_apache2.rb
707
+ - test/plugin/test_parser_apache_error.rb
708
+ - test/plugin/test_parser_base.rb
709
+ - test/plugin/test_parser_csv.rb
710
+ - test/plugin/test_parser_json.rb
711
+ - test/plugin/test_parser_labeled_tsv.rb
712
+ - test/plugin/test_parser_multiline.rb
713
+ - test/plugin/test_parser_nginx.rb
714
+ - test/plugin/test_parser_none.rb
715
+ - test/plugin/test_parser_regexp.rb
716
+ - test/plugin/test_parser_syslog.rb
717
+ - test/plugin/test_parser_time.rb
718
+ - test/plugin/test_parser_tsv.rb
661
719
  - test/plugin/test_storage.rb
662
720
  - test/plugin/test_storage_local.rb
663
721
  - test/plugin/test_string_util.rb
@@ -665,6 +723,9 @@ test_files:
665
723
  - test/plugin_helper/test_compat_parameters.rb
666
724
  - test/plugin_helper/test_event_emitter.rb
667
725
  - test/plugin_helper/test_event_loop.rb
726
+ - test/plugin_helper/test_formatter.rb
727
+ - test/plugin_helper/test_inject.rb
728
+ - test/plugin_helper/test_parser.rb
668
729
  - test/plugin_helper/test_retry_state.rb
669
730
  - test/plugin_helper/test_storage.rb
670
731
  - test/plugin_helper/test_thread.rb
@@ -672,6 +733,7 @@ test_files:
672
733
  - test/scripts/exec_script.rb
673
734
  - test/scripts/fluent/plugin/formatter_known.rb
674
735
  - test/scripts/fluent/plugin/out_test.rb
736
+ - test/scripts/fluent/plugin/out_test2.rb
675
737
  - test/scripts/fluent/plugin/parser_known.rb
676
738
  - test/test_config.rb
677
739
  - test/test_configdsl.rb
@@ -685,11 +747,11 @@ test_files:
685
747
  - test/test_match.rb
686
748
  - test/test_mixin.rb
687
749
  - test/test_output.rb
688
- - test/test_parser.rb
689
750
  - test/test_plugin_classes.rb
690
751
  - test/test_plugin_helper.rb
691
752
  - test/test_process.rb
692
753
  - test/test_root_agent.rb
693
754
  - test/test_supervisor.rb
755
+ - test/test_time_formatter.rb
694
756
  - test/test_unique_id.rb
695
757
  has_rdoc: false