Skip to content

Commit 34d7559

Browse files
committed
parser: json: use new pack_json wrapper with optimizations
Signed-off-by: Eduardo Silva <[email protected]>
1 parent 797bb80 commit 34d7559

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/flb_parser_json.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
#include <fluent-bit/flb_parser.h>
2424
#include <fluent-bit/flb_pack.h>
25+
#include <fluent-bit/flb_pack_json.h>
2526
#include <fluent-bit/flb_mem.h>
2627
#include <fluent-bit/flb_parser_decoder.h>
2728

@@ -56,12 +57,15 @@ int flb_parser_json_do(struct flb_parser *parser,
5657
struct flb_tm tm = {0};
5758
struct flb_time *t;
5859
size_t consumed;
60+
struct flb_pack_opts pack_opts = {0};
5961

6062
consumed = 0;
6163

6264
/* Convert incoming in_buf JSON message to message pack format */
63-
ret = flb_pack_json_recs(in_buf, in_size, &mp_buf, &mp_size, &root_type,
64-
&records, &consumed);
65+
pack_opts.backend = FLB_PACK_JSON_BACKEND_YYJSON;
66+
ret = flb_pack_json_recs_ext(in_buf, in_size, &mp_buf, &mp_size,
67+
&root_type, &records, &consumed,
68+
&pack_opts);
6569
if (ret != 0) {
6670
return -1;
6771
}

0 commit comments

Comments
 (0)