udp
Last updated
Last updated
The in_udp
Input plugin enables Fluentd to accept UDP payload.
It is included in Fluentd's core.
Refer to the Configuration File article for the basic structure and syntax of the configuration file.
For <parse>
, refer to Parse Section.
We have observed drastic performance improvements on Linux, with proper kernel parameter settings (e.g. net.core.rmem_max
parameter). If you have high-volume UDP traffic, please make sure to follow Before Installing Fluentd instructions.
See Common Parameters.
@type
The value must be udp
.
tag
type | default | version |
---|---|---|
string | required parameter | 0.14.0 |
The tag of the output events.
port
type | default | version |
---|---|---|
integer | 5160 | 0.14.0 |
The port to listen to. (default: 5160
)
bind
type | default | version |
---|---|---|
string | 0.0.0.0 (all addresses) | 0.14.0 |
The bind address to listen to.
source_hostname_key
type | default | version |
---|---|---|
string | nil (no adding hostname) | 0.14.10 |
The field name of the client's hostname. If it is set, the client's hostname will be set to its key.
If you set the following configuration:
then the client's hostname is set to client_host
field i.e.:
source_address_key
type | default | version |
---|---|---|
string | nil (no adding source address) | 1.4.2 |
The field name for the client's IP address. If you set this option, Fluentd automatically adds the remote address to each data record.
For example, if you have the following configuration:
You will get something like this:
message_length_limit
type | default | version |
---|---|---|
size | 4096 | 0.14.14 |
The maximum number of bytes for the message.
remove_newline
type | default | version |
---|---|---|
bool | true | 0.14.23 |
Removes the newline from the end of the incoming payload.
receive_buffer_size
type | default | version |
---|---|---|
size | nil | 1.0.1 |
The max size of socket receive buffer. This is used in SO_RCVBUF
socket option.
<parse>
Sectionrequired | multi | version |
---|---|---|
true | false | 0.14.10 |
in_udp
uses the parser plugin to parse the payload.
For more details:
Here is a Ruby example to send an event to in_udp
:
If in_udp
gets lots of packets within 1 sec, some packets are dropped. For example, you can see bigger RcvbufErrors
number via netstat -su
.
This means that in_udp
with one process cannot handle such traffic loads. Try multi workers.
If you are trying to receive binary data containing '\r' (0x0d
) or '\n' (0x0a
), you need to tweak remove_newline
to prevent Fluentd from corrupting payloads.
For example, suppose you intend to receive packets which contain the following data:
you need to be careful that the default behaviour of Fluentd is to trim the 6th byte (0x0a
) from payload. If you do not want this behaviour, please configure remove_newline
to false
.
If this article is incorrect or outdated, or omits critical information, please let us know. Fluentd is an open-source project under Cloud Native Computing Foundation (CNCF). All components are available under the Apache 2 License.