Skip to content

Document difference of JSON formats #300

Closed as not planned
Closed as not planned
@l2dy

Description

@l2dy

Behavior of json, json_stream and json_lines should be documented. Related comments in code:

https://github.com/fluent/fluent-bit/blob/v1.4.2/src/flb_pack.c#L745-L754
https://github.com/fluent/fluent-bit/blob/v1.4.2/src/flb_pack.c#L820-L833

    /*
     * If the format is the original msgpack style of one big array,
     * registrate the array, otherwise is not necessary. FYI, original format:
     *
     * [
     *   [timestamp, map],
     *   [timestamp, map],
     *   [T, M]...
     * ]
     */
;
        /*
         * Here we handle two types of records concatenation:
         *
         * FLB_PACK_JSON_FORMAT_LINES: add  breakline (\n) after each record
         *
         *
         *     {'ts':abc,'k1':1}
         *     {'ts':abc,'k1':2}
         *     {N}
         *
         * FLB_PACK_JSON_FORMAT_STREAM: no separators, e.g:
         *
         *     {'ts':abc,'k1':1}{'ts':abc,'k1':2}{N}
         */

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions