fluentd 0.14.7-x64-mingw32 → 0.14.10-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.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +2 -0
- data/CONTRIBUTING.md +6 -1
- data/ChangeLog +95 -0
- data/Rakefile +21 -0
- data/appveyor.yml +1 -0
- data/code-of-conduct.md +3 -0
- data/example/out_exec_filter.conf +42 -0
- data/fluentd.gemspec +1 -1
- data/lib/fluent/agent.rb +2 -2
- data/lib/fluent/command/binlog_reader.rb +1 -1
- data/lib/fluent/command/cat.rb +15 -4
- data/lib/fluent/compat/output.rb +14 -9
- data/lib/fluent/compat/parser.rb +141 -11
- data/lib/fluent/config/configure_proxy.rb +2 -11
- data/lib/fluent/config/section.rb +8 -1
- data/lib/fluent/configurable.rb +1 -3
- data/lib/fluent/env.rb +1 -1
- data/lib/fluent/log.rb +1 -1
- data/lib/fluent/plugin/base.rb +17 -0
- data/lib/fluent/plugin/filter_parser.rb +108 -0
- data/lib/fluent/plugin/filter_record_transformer.rb +14 -35
- data/lib/fluent/plugin/filter_stdout.rb +1 -1
- data/lib/fluent/plugin/formatter.rb +5 -0
- data/lib/fluent/plugin/formatter_msgpack.rb +4 -0
- data/lib/fluent/plugin/formatter_stdout.rb +3 -2
- data/lib/fluent/plugin/formatter_tsv.rb +34 -0
- data/lib/fluent/plugin/in_exec.rb +48 -93
- data/lib/fluent/plugin/in_forward.rb +66 -265
- data/lib/fluent/plugin/in_http.rb +68 -65
- data/lib/fluent/plugin/in_monitor_agent.rb +8 -4
- data/lib/fluent/plugin/in_syslog.rb +42 -58
- data/lib/fluent/plugin/in_tail.rb +29 -14
- data/lib/fluent/plugin/in_tcp.rb +54 -14
- data/lib/fluent/plugin/in_udp.rb +49 -13
- data/lib/fluent/plugin/multi_output.rb +1 -3
- data/lib/fluent/plugin/out_exec.rb +58 -71
- data/lib/fluent/plugin/out_exec_filter.rb +199 -279
- data/lib/fluent/plugin/out_file.rb +172 -81
- data/lib/fluent/plugin/out_forward.rb +229 -206
- data/lib/fluent/plugin/out_stdout.rb +6 -21
- data/lib/fluent/plugin/output.rb +90 -59
- data/lib/fluent/plugin/parser.rb +121 -61
- data/lib/fluent/plugin/parser_csv.rb +9 -3
- data/lib/fluent/plugin/parser_json.rb +37 -35
- data/lib/fluent/plugin/parser_ltsv.rb +11 -19
- data/lib/fluent/plugin/parser_msgpack.rb +50 -0
- data/lib/fluent/plugin/parser_regexp.rb +15 -42
- data/lib/fluent/plugin/parser_tsv.rb +8 -3
- data/lib/fluent/plugin_helper.rb +10 -1
- data/lib/fluent/plugin_helper/child_process.rb +139 -73
- data/lib/fluent/plugin_helper/compat_parameters.rb +93 -4
- data/lib/fluent/plugin_helper/event_emitter.rb +14 -1
- data/lib/fluent/plugin_helper/event_loop.rb +24 -6
- data/lib/fluent/plugin_helper/extract.rb +16 -4
- data/lib/fluent/plugin_helper/formatter.rb +9 -11
- data/lib/fluent/plugin_helper/inject.rb +16 -1
- data/lib/fluent/plugin_helper/parser.rb +3 -3
- data/lib/fluent/plugin_helper/server.rb +494 -0
- data/lib/fluent/plugin_helper/socket.rb +101 -0
- data/lib/fluent/plugin_helper/socket_option.rb +84 -0
- data/lib/fluent/plugin_helper/timer.rb +1 -0
- data/lib/fluent/root_agent.rb +1 -1
- data/lib/fluent/test/driver/base.rb +95 -49
- data/lib/fluent/test/driver/base_owner.rb +18 -8
- data/lib/fluent/test/driver/multi_output.rb +2 -1
- data/lib/fluent/test/driver/output.rb +29 -6
- data/lib/fluent/test/helpers.rb +3 -1
- data/lib/fluent/test/log.rb +4 -0
- data/lib/fluent/test/startup_shutdown.rb +13 -0
- data/lib/fluent/time.rb +14 -8
- data/lib/fluent/version.rb +1 -1
- data/lib/fluent/winsvc.rb +1 -1
- data/test/command/test_binlog_reader.rb +5 -1
- data/test/compat/test_parser.rb +10 -0
- data/test/config/test_configurable.rb +193 -0
- data/test/config/test_configure_proxy.rb +0 -43
- data/test/helper.rb +36 -1
- data/test/plugin/test_base.rb +16 -0
- data/test/plugin/test_filter_parser.rb +665 -0
- data/test/plugin/test_filter_record_transformer.rb +36 -100
- data/test/plugin/test_filter_stdout.rb +18 -27
- data/test/plugin/test_in_dummy.rb +1 -1
- data/test/plugin/test_in_exec.rb +206 -94
- data/test/plugin/test_in_forward.rb +268 -347
- data/test/plugin/test_in_http.rb +310 -186
- data/test/plugin/test_in_monitor_agent.rb +65 -35
- data/test/plugin/test_in_syslog.rb +39 -3
- data/test/plugin/test_in_tcp.rb +78 -62
- data/test/plugin/test_in_udp.rb +101 -80
- data/test/plugin/test_out_exec.rb +223 -68
- data/test/plugin/test_out_exec_filter.rb +520 -169
- data/test/plugin/test_out_file.rb +637 -177
- data/test/plugin/test_out_forward.rb +242 -234
- data/test/plugin/test_out_null.rb +1 -1
- data/test/plugin/test_out_secondary_file.rb +4 -2
- data/test/plugin/test_out_stdout.rb +14 -35
- data/test/plugin/test_output_as_buffered.rb +60 -2
- data/test/plugin/test_parser.rb +359 -0
- data/test/plugin/test_parser_csv.rb +1 -2
- data/test/plugin/test_parser_json.rb +3 -4
- data/test/plugin/test_parser_labeled_tsv.rb +1 -2
- data/test/plugin/test_parser_none.rb +1 -2
- data/test/plugin/test_parser_regexp.rb +8 -4
- data/test/plugin/test_parser_tsv.rb +4 -3
- data/test/plugin_helper/test_child_process.rb +184 -0
- data/test/plugin_helper/test_compat_parameters.rb +88 -1
- data/test/plugin_helper/test_extract.rb +0 -1
- data/test/plugin_helper/test_formatter.rb +5 -2
- data/test/plugin_helper/test_inject.rb +21 -0
- data/test/plugin_helper/test_parser.rb +6 -5
- data/test/plugin_helper/test_server.rb +905 -0
- data/test/test_event_time.rb +3 -1
- data/test/test_output.rb +53 -2
- data/test/test_plugin_classes.rb +20 -0
- data/test/test_root_agent.rb +139 -0
- data/test/test_test_drivers.rb +135 -0
- metadata +28 -8
- data/test/plugin/test_parser_base.rb +0 -32
data/test/test_event_time.rb
CHANGED
@@ -51,7 +51,9 @@ class EventTimeTest < Test::Unit::TestCase
|
|
51
51
|
|
52
52
|
test 'Oj.dump' do
|
53
53
|
time = Fluent::EventTime.new(100)
|
54
|
-
|
54
|
+
require 'fluent/env'
|
55
|
+
Oj.default_options = Fluent::DEFAULT_OJ_OPTIONS
|
56
|
+
assert_equal('{"time":100}', Oj.dump({'time' => time}))
|
55
57
|
assert_equal('["tag",100,{"key":"value"}]', Oj.dump(["tag", time, {"key" => "value"}], mode: :compat))
|
56
58
|
end
|
57
59
|
|
data/test/test_output.rb
CHANGED
@@ -178,12 +178,32 @@ module FluentOutputTest
|
|
178
178
|
|
179
179
|
CONFIG = %[
|
180
180
|
buffer_path #{TMP_DIR}/foo
|
181
|
-
time_slice_format %Y%m%d
|
181
|
+
time_slice_format %Y%m%d%H
|
182
182
|
]
|
183
183
|
|
184
184
|
class TimeSlicedOutputTestPlugin < Fluent::TimeSlicedOutput
|
185
|
+
attr_reader :written_chunk_keys, :errors_in_write
|
186
|
+
def initialize
|
187
|
+
super
|
188
|
+
@written_chunk_keys = []
|
189
|
+
@errors_in_write = []
|
190
|
+
end
|
191
|
+
|
192
|
+
def configure(conf)
|
193
|
+
super
|
194
|
+
|
195
|
+
@formatter = Fluent::Plugin.new_formatter('out_file')
|
196
|
+
@formatter.configure(conf)
|
197
|
+
end
|
198
|
+
|
185
199
|
def format(tag, time, record)
|
186
|
-
|
200
|
+
@formatter.format(tag, time, record)
|
201
|
+
end
|
202
|
+
def write(chunk)
|
203
|
+
@written_chunk_keys << chunk.key
|
204
|
+
true
|
205
|
+
rescue => e
|
206
|
+
@errors_in_write << e
|
187
207
|
end
|
188
208
|
end
|
189
209
|
|
@@ -191,6 +211,16 @@ module FluentOutputTest
|
|
191
211
|
Fluent::Test::TimeSlicedOutputTestDriver.new(TimeSlicedOutputTestPlugin).configure(conf, true)
|
192
212
|
end
|
193
213
|
|
214
|
+
data(:none => '',
|
215
|
+
:utc => "utc",
|
216
|
+
:localtime => 'localtime',
|
217
|
+
:timezone => 'timezone +0000')
|
218
|
+
test 'configure with timezone related parameters' do |param|
|
219
|
+
assert_nothing_raised {
|
220
|
+
create_driver(CONFIG + param)
|
221
|
+
}
|
222
|
+
end
|
223
|
+
|
194
224
|
sub_test_case "test emit" do
|
195
225
|
setup do
|
196
226
|
@time = Time.parse("2011-01-02 13:14:15 UTC")
|
@@ -209,6 +239,27 @@ module FluentOutputTest
|
|
209
239
|
d.instance.emit_events('test', OneEventStream.new('string', 10))
|
210
240
|
end
|
211
241
|
end
|
242
|
+
|
243
|
+
test "plugin can get key of chunk in #write" do
|
244
|
+
d = create_driver
|
245
|
+
d.instance.start
|
246
|
+
d.instance.after_start
|
247
|
+
d.instance.emit_events('test', OneEventStream.new(event_time("2016-11-08 17:44:30 +0900"), {"message" => "yay"}))
|
248
|
+
d.instance.force_flush
|
249
|
+
assert_equal [], d.instance.errors_in_write
|
250
|
+
assert_equal ["2016110808"], d.instance.written_chunk_keys # default timezone is UTC
|
251
|
+
end
|
252
|
+
|
253
|
+
test "check formatted time compatibility with utc. Should Z, not +00:00" do
|
254
|
+
d = create_driver(CONFIG + %[
|
255
|
+
utc
|
256
|
+
include_time_key
|
257
|
+
])
|
258
|
+
time = Time.parse("2016-11-08 12:00:00 UTC").to_i
|
259
|
+
d.emit({"a" => 1}, time)
|
260
|
+
d.expect_format %[2016-11-08T12:00:00Z\ttest\t{"a":1,"time":"2016-11-08T12:00:00Z"}\n]
|
261
|
+
d.run
|
262
|
+
end
|
212
263
|
end
|
213
264
|
end
|
214
265
|
end
|
data/test/test_plugin_classes.rb
CHANGED
@@ -110,6 +110,26 @@ module FluentTest
|
|
110
110
|
end
|
111
111
|
end
|
112
112
|
|
113
|
+
class FluentTestBufferedOutput < ::Fluent::Plugin::Output
|
114
|
+
::Fluent::Plugin.register_output('test_out_buffered', self)
|
115
|
+
def write(chunk)
|
116
|
+
# drop everything
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
class FluentTestEmitOutput < ::Fluent::Plugin::Output
|
121
|
+
::Fluent::Plugin.register_output('test_out_emit', self)
|
122
|
+
helpers :event_emitter
|
123
|
+
def write(chunk)
|
124
|
+
tag = chunk.metadata.tag || 'test'
|
125
|
+
array = []
|
126
|
+
chunk.each do |time, record|
|
127
|
+
array << [time, record]
|
128
|
+
end
|
129
|
+
router.emit_array(tag, array)
|
130
|
+
end
|
131
|
+
end
|
132
|
+
|
113
133
|
class FluentTestErrorOutput < ::Fluent::Plugin::Output
|
114
134
|
::Fluent::Plugin.register_output('test_out_error', self)
|
115
135
|
|
data/test/test_root_agent.rb
CHANGED
@@ -207,6 +207,145 @@ EOC
|
|
207
207
|
end
|
208
208
|
end
|
209
209
|
|
210
|
+
sub_test_case 'configured with label and secondary plugin' do
|
211
|
+
setup do
|
212
|
+
@ra = RootAgent.new(log: $log)
|
213
|
+
stub(Engine).root_agent{ @ra }
|
214
|
+
@ra.configure(Config.parse(<<-EOC, "(test)", "(test_dir)", true))
|
215
|
+
<source>
|
216
|
+
@type test_in
|
217
|
+
@label @route_a
|
218
|
+
</source>
|
219
|
+
<label @route_a>
|
220
|
+
<match a.**>
|
221
|
+
@type test_out_buffered
|
222
|
+
<secondary>
|
223
|
+
@type test_out_emit
|
224
|
+
</secondary>
|
225
|
+
</match>
|
226
|
+
</label>
|
227
|
+
<label @route_b>
|
228
|
+
<match b.**>
|
229
|
+
@type test_out
|
230
|
+
</match>
|
231
|
+
</label>
|
232
|
+
EOC
|
233
|
+
end
|
234
|
+
|
235
|
+
test 'secondary plugin has an event router for the label which the plugin is in' do
|
236
|
+
assert_equal 1, @ra.inputs.size
|
237
|
+
assert_equal 2, @ra.labels.size
|
238
|
+
assert_equal ['@route_a', '@route_b'], @ra.labels.keys
|
239
|
+
assert_equal '@route_a', @ra.labels['@route_a'].context
|
240
|
+
assert_equal '@route_b', @ra.labels['@route_b'].context
|
241
|
+
|
242
|
+
c1 = @ra.labels['@route_a']
|
243
|
+
|
244
|
+
assert_equal 1, c1.outputs.size
|
245
|
+
assert !c1.outputs.first.has_router?
|
246
|
+
|
247
|
+
assert c1.outputs.first.secondary
|
248
|
+
assert c1.outputs.first.secondary.has_router?
|
249
|
+
assert_equal c1.event_router, c1.outputs.first.secondary.router
|
250
|
+
end
|
251
|
+
end
|
252
|
+
|
253
|
+
sub_test_case 'configured with label and secondary plugin with @label specifier' do
|
254
|
+
setup do
|
255
|
+
@ra = RootAgent.new(log: $log)
|
256
|
+
stub(Engine).root_agent{ @ra }
|
257
|
+
@ra.configure(Config.parse(<<-EOC, "(test)", "(test_dir)", true))
|
258
|
+
<source>
|
259
|
+
@type test_in
|
260
|
+
@label @route_a
|
261
|
+
</source>
|
262
|
+
<label @route_a>
|
263
|
+
<match a.**>
|
264
|
+
@type test_out_buffered
|
265
|
+
<secondary>
|
266
|
+
@type test_out_emit
|
267
|
+
@label @route_b
|
268
|
+
</secondary>
|
269
|
+
</match>
|
270
|
+
</label>
|
271
|
+
<label @route_b>
|
272
|
+
<match b.**>
|
273
|
+
@type test_out
|
274
|
+
</match>
|
275
|
+
</label>
|
276
|
+
EOC
|
277
|
+
end
|
278
|
+
|
279
|
+
test 'secondary plugin has an event router for the label specified in secondary section' do
|
280
|
+
assert_equal 1, @ra.inputs.size
|
281
|
+
assert_equal 2, @ra.labels.size
|
282
|
+
assert_equal ['@route_a', '@route_b'], @ra.labels.keys
|
283
|
+
assert_equal '@route_a', @ra.labels['@route_a'].context
|
284
|
+
assert_equal '@route_b', @ra.labels['@route_b'].context
|
285
|
+
|
286
|
+
c1 = @ra.labels['@route_a']
|
287
|
+
c2 = @ra.labels['@route_b']
|
288
|
+
|
289
|
+
assert_equal 1, c1.outputs.size
|
290
|
+
assert !c1.outputs.first.has_router?
|
291
|
+
|
292
|
+
assert c1.outputs.first.secondary
|
293
|
+
assert c1.outputs.first.secondary.has_router?
|
294
|
+
assert_equal c2.event_router, c1.outputs.first.secondary.router
|
295
|
+
end
|
296
|
+
end
|
297
|
+
|
298
|
+
sub_test_case 'configured with label and secondary plugin with @label specifier in primary output' do
|
299
|
+
setup do
|
300
|
+
@ra = RootAgent.new(log: $log)
|
301
|
+
stub(Engine).root_agent{ @ra }
|
302
|
+
@ra.configure(Config.parse(<<-EOC, "(test)", "(test_dir)", true))
|
303
|
+
<source>
|
304
|
+
@type test_in
|
305
|
+
@label @route_a
|
306
|
+
</source>
|
307
|
+
<label @route_a>
|
308
|
+
<match a.**>
|
309
|
+
@type test_out_emit
|
310
|
+
@label @route_b
|
311
|
+
<secondary>
|
312
|
+
@type test_out_emit
|
313
|
+
</secondary>
|
314
|
+
</match>
|
315
|
+
</label>
|
316
|
+
<label @route_b>
|
317
|
+
<match b.**>
|
318
|
+
@type test_out
|
319
|
+
</match>
|
320
|
+
</label>
|
321
|
+
EOC
|
322
|
+
end
|
323
|
+
|
324
|
+
test 'secondary plugin has an event router for the label specified in secondary section' do
|
325
|
+
assert_equal 1, @ra.inputs.size
|
326
|
+
assert_equal 2, @ra.labels.size
|
327
|
+
assert_equal ['@route_a', '@route_b'], @ra.labels.keys
|
328
|
+
assert_equal '@route_a', @ra.labels['@route_a'].context
|
329
|
+
assert_equal '@route_b', @ra.labels['@route_b'].context
|
330
|
+
|
331
|
+
c1 = @ra.labels['@route_a']
|
332
|
+
c2 = @ra.labels['@route_b']
|
333
|
+
|
334
|
+
assert_equal 1, c1.outputs.size
|
335
|
+
assert c1.outputs.first.secondary
|
336
|
+
|
337
|
+
p1 = c1.outputs.first
|
338
|
+
assert p1.has_router?
|
339
|
+
assert_equal c1.event_router, p1.context_router
|
340
|
+
assert_equal c2.event_router, p1.router
|
341
|
+
|
342
|
+
s1 = p1.secondary
|
343
|
+
assert s1.has_router?
|
344
|
+
assert_equal c1.event_router, s1.context_router
|
345
|
+
assert_equal c2.event_router, s1.router
|
346
|
+
end
|
347
|
+
end
|
348
|
+
|
210
349
|
sub_test_case 'configured with MultiOutput plugins' do
|
211
350
|
setup do
|
212
351
|
@ra = RootAgent.new(log: $log)
|
@@ -0,0 +1,135 @@
|
|
1
|
+
require_relative 'helper'
|
2
|
+
require 'fluent/plugin/input'
|
3
|
+
require 'fluent/test/driver/input'
|
4
|
+
require 'fluent/plugin/output'
|
5
|
+
require 'fluent/test/driver/output'
|
6
|
+
require 'fluent/plugin/filter'
|
7
|
+
require 'fluent/test/driver/filter'
|
8
|
+
require 'fluent/plugin/multi_output'
|
9
|
+
require 'fluent/test/driver/multi_output'
|
10
|
+
require 'fluent/plugin/parser'
|
11
|
+
require 'fluent/test/driver/parser'
|
12
|
+
require 'fluent/plugin/formatter'
|
13
|
+
require 'fluent/test/driver/formatter'
|
14
|
+
|
15
|
+
require 'timecop'
|
16
|
+
|
17
|
+
class TestDriverTest < ::Test::Unit::TestCase
|
18
|
+
def setup
|
19
|
+
Fluent::Test.setup
|
20
|
+
end
|
21
|
+
|
22
|
+
sub_test_case 'plugin test driver' do
|
23
|
+
data(
|
24
|
+
'input plugin test driver' => [Fluent::Test::Driver::Input, Fluent::Plugin::Input],
|
25
|
+
'multi_output plugin test driver' => [Fluent::Test::Driver::MultiOutput, Fluent::Plugin::MultiOutput],
|
26
|
+
'parser plugin test driver' => [Fluent::Test::Driver::Parser, Fluent::Plugin::Parser],
|
27
|
+
'formatter plugin test driver' => [Fluent::Test::Driver::Formatter, Fluent::Plugin::Formatter],
|
28
|
+
)
|
29
|
+
test 'returns the block value as the return value of #run' do |args|
|
30
|
+
driver_class, plugin_class = args
|
31
|
+
d = driver_class.new(Class.new(plugin_class))
|
32
|
+
v = d.run do
|
33
|
+
x = 1 + 2
|
34
|
+
y = 2 + 4
|
35
|
+
3 || x || y
|
36
|
+
end
|
37
|
+
assert_equal 3, v
|
38
|
+
end
|
39
|
+
|
40
|
+
data(
|
41
|
+
'input plugin test driver' => [Fluent::Test::Driver::Input, Fluent::Plugin::Input],
|
42
|
+
'multi_output plugin test driver' => [Fluent::Test::Driver::MultiOutput, Fluent::Plugin::MultiOutput],
|
43
|
+
'parser plugin test driver' => [Fluent::Test::Driver::Parser, Fluent::Plugin::Parser],
|
44
|
+
'formatter plugin test driver' => [Fluent::Test::Driver::Formatter, Fluent::Plugin::Formatter],
|
45
|
+
)
|
46
|
+
test 'raises error for hard timeout' do |args|
|
47
|
+
driver_class, plugin_class = args
|
48
|
+
d = driver_class.new(Class.new(plugin_class))
|
49
|
+
assert_raise Fluent::Test::Driver::TestTimedOut do
|
50
|
+
d.run(timeout: 1) do
|
51
|
+
sleep 5
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
56
|
+
data(
|
57
|
+
'input plugin test driver' => [Fluent::Test::Driver::Input, Fluent::Plugin::Input],
|
58
|
+
'multi_output plugin test driver' => [Fluent::Test::Driver::MultiOutput, Fluent::Plugin::MultiOutput],
|
59
|
+
'parser plugin test driver' => [Fluent::Test::Driver::Parser, Fluent::Plugin::Parser],
|
60
|
+
'formatter plugin test driver' => [Fluent::Test::Driver::Formatter, Fluent::Plugin::Formatter],
|
61
|
+
)
|
62
|
+
test 'can stop with soft timeout for blocks never stops, even with Timecop' do |args|
|
63
|
+
Timecop.freeze(Time.parse("2016-11-04 18:49:00"))
|
64
|
+
begin
|
65
|
+
driver_class, plugin_class = args
|
66
|
+
d = driver_class.new(Class.new(plugin_class))
|
67
|
+
assert_nothing_raised do
|
68
|
+
before = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
69
|
+
d.end_if{ false }
|
70
|
+
d.run(timeout: 1) do
|
71
|
+
sleep 0.1 until d.stop?
|
72
|
+
end
|
73
|
+
after = Process.clock_gettime(Process::CLOCK_MONOTONIC)
|
74
|
+
assert{ after >= before + 1.0 }
|
75
|
+
end
|
76
|
+
ensure
|
77
|
+
Timecop.return
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
test 'raise errors raised in threads' do
|
82
|
+
d = Fluent::Test::Driver::Input.new(Fluent::Plugin::Input) do
|
83
|
+
helpers :thread
|
84
|
+
def start
|
85
|
+
super
|
86
|
+
thread_create(:input_thread_for_test_driver_test) do
|
87
|
+
sleep 0.5
|
88
|
+
raise "yaaaaaaaaaay!"
|
89
|
+
end
|
90
|
+
end
|
91
|
+
end
|
92
|
+
assert_raise "yaaaaaaaaaay!" do
|
93
|
+
d.end_if{ false }
|
94
|
+
d.run(timeout: 3) do
|
95
|
+
sleep 0.1 until d.stop?
|
96
|
+
end
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
100
|
+
|
101
|
+
sub_test_case 'output plugin test driver' do
|
102
|
+
test 'returns the block value as the return value of #run' do
|
103
|
+
d = Fluent::Test::Driver::Output.new(Fluent::Plugin::Output) do
|
104
|
+
def prefer_buffered_processing
|
105
|
+
false
|
106
|
+
end
|
107
|
+
def process(tag, es)
|
108
|
+
# drop
|
109
|
+
end
|
110
|
+
end
|
111
|
+
v = d.run do
|
112
|
+
x = 1 + 2
|
113
|
+
y = 2 + 4
|
114
|
+
3 || x || y
|
115
|
+
end
|
116
|
+
assert_equal 3, v
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
sub_test_case 'filter plugin test driver' do
|
121
|
+
test 'returns the block value as the return value of #run' do
|
122
|
+
d = Fluent::Test::Driver::Filter.new(Fluent::Plugin::Filter) do
|
123
|
+
def filter(tag, time, record)
|
124
|
+
record
|
125
|
+
end
|
126
|
+
end
|
127
|
+
v = d.run do
|
128
|
+
x = 1 + 2
|
129
|
+
y = 2 + 4
|
130
|
+
3 || x || y
|
131
|
+
end
|
132
|
+
assert_equal 3, v
|
133
|
+
end
|
134
|
+
end
|
135
|
+
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.
|
4
|
+
version: 0.14.10
|
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: 2016-
|
11
|
+
date: 2016-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: msgpack
|
@@ -62,16 +62,22 @@ dependencies:
|
|
62
62
|
name: serverengine
|
63
63
|
requirement: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- - "
|
65
|
+
- - ">="
|
66
66
|
- !ruby/object:Gem::Version
|
67
|
-
version:
|
67
|
+
version: 2.0.4
|
68
|
+
- - "<"
|
69
|
+
- !ruby/object:Gem::Version
|
70
|
+
version: 3.0.0
|
68
71
|
type: :runtime
|
69
72
|
prerelease: false
|
70
73
|
version_requirements: !ruby/object:Gem::Requirement
|
71
74
|
requirements:
|
72
|
-
- - "
|
75
|
+
- - ">="
|
73
76
|
- !ruby/object:Gem::Version
|
74
|
-
version:
|
77
|
+
version: 2.0.4
|
78
|
+
- - "<"
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
version: 3.0.0
|
75
81
|
- !ruby/object:Gem::Dependency
|
76
82
|
name: http_parser.rb
|
77
83
|
requirement: !ruby/object:Gem::Requirement
|
@@ -360,6 +366,7 @@ files:
|
|
360
366
|
- bin/fluent-debug
|
361
367
|
- bin/fluent-gem
|
362
368
|
- bin/fluentd
|
369
|
+
- code-of-conduct.md
|
363
370
|
- example/copy_roundrobin.conf
|
364
371
|
- example/filter_stdout.conf
|
365
372
|
- example/in_dummy_with_compression.conf
|
@@ -375,6 +382,7 @@ files:
|
|
375
382
|
- example/in_udp.conf
|
376
383
|
- example/multi_filters.conf
|
377
384
|
- example/out_copy.conf
|
385
|
+
- example/out_exec_filter.conf
|
378
386
|
- example/out_file.conf
|
379
387
|
- example/out_forward.conf
|
380
388
|
- example/out_forward_buf_file.conf
|
@@ -458,6 +466,7 @@ files:
|
|
458
466
|
- lib/fluent/plugin/file_wrapper.rb
|
459
467
|
- lib/fluent/plugin/filter.rb
|
460
468
|
- lib/fluent/plugin/filter_grep.rb
|
469
|
+
- lib/fluent/plugin/filter_parser.rb
|
461
470
|
- lib/fluent/plugin/filter_record_transformer.rb
|
462
471
|
- lib/fluent/plugin/filter_stdout.rb
|
463
472
|
- lib/fluent/plugin/formatter.rb
|
@@ -469,6 +478,7 @@ files:
|
|
469
478
|
- lib/fluent/plugin/formatter_out_file.rb
|
470
479
|
- lib/fluent/plugin/formatter_single_value.rb
|
471
480
|
- lib/fluent/plugin/formatter_stdout.rb
|
481
|
+
- lib/fluent/plugin/formatter_tsv.rb
|
472
482
|
- lib/fluent/plugin/in_debug_agent.rb
|
473
483
|
- lib/fluent/plugin/in_dummy.rb
|
474
484
|
- lib/fluent/plugin/in_exec.rb
|
@@ -504,6 +514,7 @@ files:
|
|
504
514
|
- lib/fluent/plugin/parser_csv.rb
|
505
515
|
- lib/fluent/plugin/parser_json.rb
|
506
516
|
- lib/fluent/plugin/parser_ltsv.rb
|
517
|
+
- lib/fluent/plugin/parser_msgpack.rb
|
507
518
|
- lib/fluent/plugin/parser_multiline.rb
|
508
519
|
- lib/fluent/plugin/parser_nginx.rb
|
509
520
|
- lib/fluent/plugin/parser_none.rb
|
@@ -524,6 +535,9 @@ files:
|
|
524
535
|
- lib/fluent/plugin_helper/inject.rb
|
525
536
|
- lib/fluent/plugin_helper/parser.rb
|
526
537
|
- lib/fluent/plugin_helper/retry_state.rb
|
538
|
+
- lib/fluent/plugin_helper/server.rb
|
539
|
+
- lib/fluent/plugin_helper/socket.rb
|
540
|
+
- lib/fluent/plugin_helper/socket_option.rb
|
527
541
|
- lib/fluent/plugin_helper/storage.rb
|
528
542
|
- lib/fluent/plugin_helper/thread.rb
|
529
543
|
- lib/fluent/plugin_helper/timer.rb
|
@@ -592,6 +606,7 @@ files:
|
|
592
606
|
- test/plugin/test_file_util.rb
|
593
607
|
- test/plugin/test_filter.rb
|
594
608
|
- test/plugin/test_filter_grep.rb
|
609
|
+
- test/plugin/test_filter_parser.rb
|
595
610
|
- test/plugin/test_filter_record_transformer.rb
|
596
611
|
- test/plugin/test_filter_stdout.rb
|
597
612
|
- test/plugin/test_formatter_csv.rb
|
@@ -634,10 +649,10 @@ files:
|
|
634
649
|
- test/plugin/test_output_as_buffered_secondary.rb
|
635
650
|
- test/plugin/test_output_as_standard.rb
|
636
651
|
- test/plugin/test_owned_by.rb
|
652
|
+
- test/plugin/test_parser.rb
|
637
653
|
- test/plugin/test_parser_apache.rb
|
638
654
|
- test/plugin/test_parser_apache2.rb
|
639
655
|
- test/plugin/test_parser_apache_error.rb
|
640
|
-
- test/plugin/test_parser_base.rb
|
641
656
|
- test/plugin/test_parser_csv.rb
|
642
657
|
- test/plugin/test_parser_json.rb
|
643
658
|
- test/plugin/test_parser_labeled_tsv.rb
|
@@ -659,6 +674,7 @@ files:
|
|
659
674
|
- test/plugin_helper/test_inject.rb
|
660
675
|
- test/plugin_helper/test_parser.rb
|
661
676
|
- test/plugin_helper/test_retry_state.rb
|
677
|
+
- test/plugin_helper/test_server.rb
|
662
678
|
- test/plugin_helper/test_storage.rb
|
663
679
|
- test/plugin_helper/test_thread.rb
|
664
680
|
- test/plugin_helper/test_timer.rb
|
@@ -686,6 +702,7 @@ files:
|
|
686
702
|
- test/test_process.rb
|
687
703
|
- test/test_root_agent.rb
|
688
704
|
- test/test_supervisor.rb
|
705
|
+
- test/test_test_drivers.rb
|
689
706
|
- test/test_time_formatter.rb
|
690
707
|
- test/test_time_parser.rb
|
691
708
|
- test/test_unique_id.rb
|
@@ -746,6 +763,7 @@ test_files:
|
|
746
763
|
- test/plugin/test_file_util.rb
|
747
764
|
- test/plugin/test_filter.rb
|
748
765
|
- test/plugin/test_filter_grep.rb
|
766
|
+
- test/plugin/test_filter_parser.rb
|
749
767
|
- test/plugin/test_filter_record_transformer.rb
|
750
768
|
- test/plugin/test_filter_stdout.rb
|
751
769
|
- test/plugin/test_formatter_csv.rb
|
@@ -788,10 +806,10 @@ test_files:
|
|
788
806
|
- test/plugin/test_output_as_buffered_secondary.rb
|
789
807
|
- test/plugin/test_output_as_standard.rb
|
790
808
|
- test/plugin/test_owned_by.rb
|
809
|
+
- test/plugin/test_parser.rb
|
791
810
|
- test/plugin/test_parser_apache.rb
|
792
811
|
- test/plugin/test_parser_apache2.rb
|
793
812
|
- test/plugin/test_parser_apache_error.rb
|
794
|
-
- test/plugin/test_parser_base.rb
|
795
813
|
- test/plugin/test_parser_csv.rb
|
796
814
|
- test/plugin/test_parser_json.rb
|
797
815
|
- test/plugin/test_parser_labeled_tsv.rb
|
@@ -813,6 +831,7 @@ test_files:
|
|
813
831
|
- test/plugin_helper/test_inject.rb
|
814
832
|
- test/plugin_helper/test_parser.rb
|
815
833
|
- test/plugin_helper/test_retry_state.rb
|
834
|
+
- test/plugin_helper/test_server.rb
|
816
835
|
- test/plugin_helper/test_storage.rb
|
817
836
|
- test/plugin_helper/test_thread.rb
|
818
837
|
- test/plugin_helper/test_timer.rb
|
@@ -840,6 +859,7 @@ test_files:
|
|
840
859
|
- test/test_process.rb
|
841
860
|
- test/test_root_agent.rb
|
842
861
|
- test/test_supervisor.rb
|
862
|
+
- test/test_test_drivers.rb
|
843
863
|
- test/test_time_formatter.rb
|
844
864
|
- test/test_time_parser.rb
|
845
865
|
- test/test_unique_id.rb
|