Add udp and tcp input#368
Conversation
StreamInput based TcpInput is obsoleted since 2+ years ago. So we can remove this class for newer plugin
|
I will take a closer look and test today. It might be a good idea to check with @frsyuki why the standard socket library wasn't used initially. |
|
I tested this locally on Ubuntu Precise VM.
|
|
@kiyoto Thank you for testing.
Hm. I can remove |
|
I also add "source_host_key" option to add source host to records. |
|
@frsyuki @kiyoto @tagomoris @sonots Do you have any concern to merge this PR? |
|
I think that using TcpInput directly is obsolete now. |
|
No. Old TcpInput is obsoleted since 2 and half years ago so there is no users. |
|
I see. |
|
@kiyoto Follow in_tail way. Now in_udp and in_tcp removes a delimiter from message. Please check. |
|
If there is no problem, I will merge this PR |
The parameter is defined at lib/fluent/plugin/in_tcp.rb:45-46
desc 'The payload is read up to this character.'
config_param :delimiter, :string, default: "\n"
but input/tcp.md only mentioned it in a comment of the example
configuration, with no section under "Parameters".
It is matched with String#index (in_tcp.rb:127), not as a pattern, so a
multi-character delimiter works; this was verified by sending
'{"k":"a"}||{"k":"b"}||' with `delimiter "||"`.
The interaction with message_length_limit follows in_tcp.rb:153-162, where
the buffer is cleared and `discard_till_next_delimiter` is set.
The parameter was introduced at fluent/fluentd#368
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
* Add delimiter parameter of in_tcp
The parameter is defined at lib/fluent/plugin/in_tcp.rb:45-46
desc 'The payload is read up to this character.'
config_param :delimiter, :string, default: "\n"
but input/tcp.md only mentioned it in a comment of the example
configuration, with no section under "Parameters".
It is matched with String#index (in_tcp.rb:127), not as a pattern, so a
multi-character delimiter works; this was verified by sending
'{"k":"a"}||{"k":"b"}||' with `delimiter "||"`.
The interaction with message_length_limit follows in_tcp.rb:153-162, where
the buffer is cleared and `discard_till_next_delimiter` is set.
The parameter was introduced at fluent/fluentd#368
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
* Add comment in example
Co-authored-by: Kentaro Hayashi <kenhys@gmail.com>
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
---------
Signed-off-by: Shizuo Fujita <fujita@clear-code.com>
Co-authored-by: Kentaro Hayashi <kenhys@gmail.com>
General approach for resolving #363
@kiyoto Could you check this PR?