Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix to convert traditional parameters #1337

Merged
merged 1 commit into from
Dec 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/fluent/plugin/out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class ACKTimeoutError < Error; end

Fluent::Plugin.register_output('forward', self)

helpers :compat_parameters

LISTEN_PORT = 24224

desc 'The timeout time when sending event logs.'
Expand Down Expand Up @@ -111,6 +113,8 @@ def initialize
end

def configure(conf)
compat_parameters_convert(conf, :buffer, default_chunk_key: 'tag')

super

unless @chunk_key_tag
Expand Down
18 changes: 18 additions & 0 deletions test/plugin/test_out_forward.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,24 @@ def test_configure
assert_equal TARGET_PORT, node.port
end

def test_configure_traditional
d = create_driver(<<EOL)
self_hostname localhost
<server>
name test
host #{TARGET_HOST}
port #{TARGET_PORT}
</server>
buffer_chunk_limit 10m
EOL
instance = d.instance
assert instance.chunk_key_tag
assert !instance.chunk_key_time
assert_equal [], instance.chunk_keys
assert{ instance.buffer.is_a?(Fluent::Plugin::MemoryBuffer) }
assert_equal( 10*1024*1024, instance.buffer.chunk_limit_size )
end

def test_configure_udp_heartbeat
d = create_driver(CONFIG + "\nheartbeat_type udp")
assert_equal :udp, d.instance.heartbeat_type
Expand Down