This is a protocol specification for Fluentd forward
input/output plugins. This protocol is also used by fluent-logger software, and many other software in ecosystem (e.g., Docker logging driver for Fluentd).
This protocol version is v1. This spec is supported by Fluentd v0.14
(v0.14.5
and later), and v1
. Protocol version v0 is supported by v0.10
and v0.12
, and protocol version v1
is compatible with v0
(All implementations which supports v1
also supports v0
).
This specification describes the fluentd forward protocol, which is used to authenticate/authorize clients/servers, and to transport events from hosts to hosts over network.
The keywords "MUST", "MUST NOT", "SHOULD", "SHOULD NOT" and "MAY" in this document are to be interpreted as described in RFC 2119. The following terms are also used:
out_forward
plugin is the reference client implementation shipped with the fluentd distribution.in_forward
plugin is the reference server implementation shipped with the fluentd distribution.UDP heartbeat message SHOULD be a byte of 0x00
in both of Client and Server.
Connections have two phases on each sessions.
Once handshake phase completes, clients can use that connection in transport phase until disconnection.
Handshake phase is optional. If server doesn't require authentication/authorization, connection becomes transport phase immediately, and client can send events without any preparation.
array
which contains handshake messages, or one or more events to the server through connections.PING
described below.Message
, Forward
, PackedForward
and CompressedPackedForward
described below.nil
value for heartbeat health check usage without any event record payload.array
s of events in transport phase on a single connection, continuously.array
s which contains handshake messages, or one or more events, from the client through connections.HELO
and PONG
messages in handshake phase to the client for authentication and authorization.array
format.in_forward
plugin also accepts JSON representation of a single event for convenience. It detect it by the first byte of the request. It is unavailable with authentication/authorization.Handshake messages are to establish connections with assurance for:
shared_key
string) for the connection.All handshake messages are msgpack array
s which contains values described below. The first element of these messages MUST show the types of messages.
shared_key
string. (required)username
and password
pair. (optional)Some values are used to implement authentication/authorization, and these are shared by server and client in handshake phase.
nonce
is generated by server, sent in HELO
and used to generate shared_key_hexdigest
in PING
and PONG
shared_key_salt
is generated by client, send in PING
and used to generate shared_key_hexdigest
in PING
and PONG
auth
salt is generated by server, sent in HELO
and used to generate password
(hexdigest) in PING
HELO message is sent from server to client.
type
is a string, equals to HELO
.options
is key-value pairs to tell options enabled in the connection to the client.HELO options
has some keys and values described below.
[ "HELO", { "nonce": "xxxxxxx", "auth": "yyyyyyyy", "keepalive": true } ]
NOTE: HELO is inspired by the command to start SMTP sessions.
PING message is sent from client to server after HELO.
type
is a string, equals to PING
.client_hostname
is a string represents the hostname of client.shared_key_salt
is a binary string of salt to generate shared_key_digest
.shared_key_hexdigest
is a hex string of SHA512 digest of shared_key_salt
, client_hostname
, nonce
and share_key
.username
is a username string for the connection, or empty string if authentication is not required.password
is a hex string of SHA512 digest of auth
salt, username
and raw password string, or empty string if authentication is not required.[ "PING", "client.hostname.example.com", "xxxxxxx_shared_key_salt", "deadbeef_shared_key_hex_digest", "a_user_name", "c0ffee_password_hex_digest" ]
PONG message is sent from server to client after PING.
type
is a string, equals to PONG
.auth_result
is a boolean value to represent result of authentication/authorization (true means success).reason
is a strong to show the reason why client is disallowed, or empty string if auth_result
is true.server_hostname
is a string represents the hostname of server.shared_key_hexdigest
is a hex string of SHA512 digest of shared_key_salt
, server_hostname
, nonce
and shared_key
.[ "PONG", true, "", "server.hostname.example.com", "deadbeef_shared_key_hex_digest" ]
If auth_result
is false, server will disconnect the connection. Otherwise, client can use the connection in transport phase.
Once the connection becomes transport phase, client can send events to servers, in one event mode of modes described below.
It carries just a event.
tag
is a string separated with '.' (e.g. myapp.access) to categorize events.time
is a EventTime value (described below), or a number of seconds since Unix epoch.record
is key-value pairs of the event record.option
is optional key-value pairs, to bring data to control servers' behavior.[ "tag.name", 1441588984, {"message": "bar"}, {"option": "optional"} ]
NOTE: EventTime is formatted into Integer in json format.
It carries a series of events as a msgpack array
on a single request.
[ "tag.name", [ [1441588984, {"message": "foo"}], [1441588985, {"message": "bar"}], [1441588986, {"message": "baz"}] ], {"option": "optional"} ]
It carries a series of events as a msgpack binary on a single request.
entries
is a binary chunk of MessagePackEventStream
which contains multiple raw msgpack representations of Entry
.MessagePackEventStream
as msgpack bin
format as its binary representation.MessagePackEventStream
as msgpack str
format for compatibility reasons.bin
and str
.Forward
mode, when decoding is not needed by any plugins.out_forward
plugin sends events by the PackedForward
mode. It encloses event records with msgpack str
format instead of bin
format for a backward compatibility reason.[ "tag.name", "<<MessagePackEventStream>>", {"option": "optional"} ]
Note for v2 protocol: PackedForward messages should be sent in bin
format.
It carries a series of events as a msgpack binary, compressed by gzip, on a single request. The supported compression algorithm is only gzip.
entries
is a gzipped binary chunk of MessagePackEventStream
, which MAY be a concatenated binary of multiple gzip binary strings.compressed
key with the value gzip
.bin
format.bin
format.Forward
mode, when decoding is not needed by any plugins.[ "tag.name", "<<CompressedMessagePackEventStream>>", {"compressed": "gzip"} ]
Entry is an array
representation of pairs of time and record, used in Forward
, PackedForward
and CompressedPackedForward
mode.
It carries an optional meta data for the request.
size
: Clients MAY send the size
option to show the number of event records in an entries by an integer as a value. Server can know the number of events without unpacking entries (especially for PackedForward and CompressedPackedForward mode).chunk
: Clients MAY send the chunk
option to confirm the server receives event records. The value is a string of Base64 representation of 128 bits unique_id
which is an ID of a set of events.compressed
: Clients MUST send the compressed
option with value gzip
to tell servers that entries is CompressedPackedForward
. Other values will be ignored.{"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 4097} {"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 1023, "compressed": "gzip"}
chunk
option is not sent.ack
: Server MUST respond ack
when the chunk
option is sent by client. The ack
response value MUST be the same value given by chunk
option from client. Client SHOULD retry to send events later when the request has a chunk
but the response has no ack
.{"ack": "p8n9gmxTQVC8/nh2wlKKeQ=="}
EventTime
uses msgpack extension format of type 0 to carry nanosecond precision of time
.
EventTime
instead of plain integer representation of second since unix epoch.EventTime
may be fixext
or ext
(with length 8).+-------+----+----+----+----+----+----+----+----+----+ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | +-------+----+----+----+----+----+----+----+----+----+ | D7 | 00 | second from epoch | nanosecond | +-------+----+----+----+----+----+----+----+----+----+ |fixext8|type| 32bits integer BE | 32bits integer BE | +-------+----+----+----+----+----+----+----+----+----+ +--------+----+----+----+----+----+----+----+----+----+----+ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | +--------+----+----+----+----+----+----+----+----+----+----+ | C7 | 08 | 00 | second from epoch | nanosecond | +--------+----+----+----+----+----+----+----+----+----+----+ | ext8 | len|type| 32bits integer BE | 32bits integer BE | +--------+----+----+----+----+----+----+----+----+----+----+
Name?
means that Name
is optional.Name*
means that Name
can occur zero or more times.<<Name>>
means binary msgpack representation of Name
.[ A, B, C ]
means an array.nil
, string
, integer
and object
means as it is.Connection ::= <<Request>>* Request ::= Message | Forward | PackedForward | nil Message ::= [ Tag, Time, Record, Option? ] Forward ::= [ Tag, MultiEventStream, Option? ] MultiEventStream ::= [ Event* ] PackedForward ::= [ Tag, MessagePackEventStream, Option? ] MessagePackEventStream ::= <<Event>>* Event ::= [ Time, Record ] Tag ::= string Time ::= integer | EventTime Record ::= object Option ::= object
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4