From: Victor Julien Date: Mon, 27 Jul 2020 17:22:52 +0000 (+0200) Subject: eve/metadata: convert to jsonbuilder X-Git-Tag: suricata-6.0.0-beta1~86 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04dad483c164486a1020de4adf7eb6698d9a7936;p=thirdparty%2Fsuricata.git eve/metadata: convert to jsonbuilder --- diff --git a/src/output-json-metadata.c b/src/output-json-metadata.c index 344cd7d2a6..37d671d2cb 100644 --- a/src/output-json-metadata.c +++ b/src/output-json-metadata.c @@ -1,4 +1,4 @@ -/* Copyright (C) 2013-2016 Open Information Security Foundation +/* Copyright (C) 2013-2020 Open Information Security Foundation * * You can copy, redistribute or modify this Program under the terms of * the GNU General Public License version 2 as published by the Free @@ -81,15 +81,12 @@ typedef struct JsonMetadataLogThread_ { static int MetadataJson(ThreadVars *tv, JsonMetadataLogThread *aft, const Packet *p) { - json_t *js = CreateJSONHeader(p, LOG_DIR_PACKET, "metadata", NULL); + JsonBuilder *js = CreateEveHeader(p, LOG_DIR_PACKET, "metadata", NULL); if (unlikely(js == NULL)) return TM_ECODE_OK; - JsonAddCommonOptions(&aft->json_output_ctx->cfg, p, p->flow, js); - OutputJSONBuffer(js, aft->file_ctx, &aft->json_buffer); - json_object_del(js, "metadata"); - json_object_clear(js); - json_decref(js); + EveAddCommonOptions(&aft->json_output_ctx->cfg, p, p->flow, js); + OutputJsonBuilderBuffer(js, aft->file_ctx, &aft->json_buffer); return TM_ECODE_OK; }