fluent-bit-docs icon indicating copy to clipboard operation
fluent-bit-docs copied to clipboard

Document difference of JSON formats

Open l2dy opened this issue 4 years ago • 0 comments

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}
         */

l2dy avatar Apr 27 '20 04:04 l2dy