A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/fluent/fluentd/wiki/Forward-Protocol-Specification-v1 below:

Forward Protocol Specification v1 · fluent/fluentd Wiki · GitHub

Fluentd Forward Protocol Specification (v1)

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).

Major Changes Between v0 and v1

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:

UDP heartbeat message SHOULD be a byte of 0x00 in both of Client and Server.

Network Transport Protocol

Connections have two phases on each sessions.

  1. Handshake(optional): In this phase, servers and clients send messages each other to establish connections after authentication and authorization. It can be skipped when server doesn't require it.
  2. Transport: In this phase, clients send events to servers, and servers send response messages if client require it.

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.

Handshake messages are to establish connections with assurance for:

All handshake messages are msgpack arrays which contains values described below. The first element of these messages MUST show the types of messages.

Authentication and Authorization

Some values are used to implement authentication/authorization, and these are shared by server and client in handshake phase.

HELO message is sent from server to client.

name Ruby type msgpack format content type String str "HELO" options Hash map described below

HELO options has some keys and values described below.

name Ruby type msgpack format content nonce String str|bin a binary string of nonce to generate digest in PING message auth String str|bin a binary string of salt to generate digest for user authentication (authentication not required if it's empty) keepalive true|false bool (optional) server disallow long life connections if false (default: true)
[
  "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.

name Ruby type msgpack format content type String str "PING" client_hostname String str FQDN hostname of client shared_key_salt String str|bin a salt binary(String) shared_key_hexdigest String str sha512_hex(shared_key_salt + client_hostname + nonce + shared_key) username String str a username or empty string password String str sha512_hex(auth_salt + username + raw_password) or empty string
[
  "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.

name Ruby type msgpack format content type String str "PONG" auth_result true|false bool auth succeeded or not reason String str reason why auth failed, or '' server_hostname String str FQDN hostname of server shared_key_hexdigest String str sha512_hex(shared_key_salt + server_hostname + nonce + 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.

name Ruby type msgpack format content tag String str tag name time EventTime|Integer ext|int time from Unix epoch in nanosecond precision(EventTime), or in second precision (Integer) record Hash map pairs of keys(String) and values(Object) option Hash map option (optional)
[
  "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.

name Ruby type msgpack format content tag String str tag name entries MultiEventStream array list of Entry option Hash map option (optional)
[
  "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.

name Ruby type msgpack format content tag String str tag name entries MessagePackEventStream bin|str msgpack stream of Entry option Hash map option (optional)
[
  "tag.name",
  "<<MessagePackEventStream>>",
  {"option": "optional"}
]

Note for v2 protocol: PackedForward messages should be sent in bin format.

CompressedPackedForward Mode

It carries a series of events as a msgpack binary, compressed by gzip, on a single request. The supported compression algorithm is only gzip.

name Ruby type msgpack format content tag String str tag name entries CompressedMessagePackEventStream bin gzipped msgpack stream of Entry option Hash map option including key "compressed" (required)
[
  "tag.name",
  "<<CompressedMessagePackEventStream>>",
  {"compressed": "gzip"}
]

Entry is an array representation of pairs of time and record, used in Forward, PackedForward and CompressedPackedForward mode.

name Ruby type msgpack format content time EventTime|Integer ext|int time from Unix epoch in nanosecond precision(EventTime), or in second precision (Integer) record Hash map pairs of keys(String) and values(Object)

It carries an optional meta data for the request.

{"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 4097}
{"chunk": "p8n9gmxTQVC8/nh2wlKKeQ==", "size": 1023, "compressed": "gzip"}
{"ack": "p8n9gmxTQVC8/nh2wlKKeQ=="}

EventTime uses msgpack extension format of type 0 to carry nanosecond precision of time.

+-------+----+----+----+----+----+----+----+----+----+
|     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 |
+--------+----+----+----+----+----+----+----+----+----+----+
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