Hi,
I meant the c source code for json-parser(), which is modules/json/json-parser.c, more specifically the json_parser_process() function:
```
static gboolean
json_parser_process(LogParser *s, LogMessage **pmsg, const LogPathOptions *path_options, const gchar *input, gsize input_len)
{
JSONParser *self = (JSONParser *) s;
struct json_object *jso;
struct json_tokener *tok;
if (self->marker)
{
if (strncmp(input, self->marker, self->marker_len) != 0)
return FALSE;
input += self->marker_len;
while (isspace(*input))
input++;
}
tok = json_tokener_new();
jso = json_tokener_parse_ex(tok, input, input_len);
if (tok->err != json_tokener_success || !jso)
{
msg_error("Unparsable JSON stream encountered",
evt_tag_str ("input", input),
tok->err != json_tokener_success ? evt_tag_str ("error", json_tokener_error_desc(tok->err)) : NULL,
NULL);
json_tokener_free (tok);
return FALSE;
}
json_tokener_free(tok);
log_msg_make_writable(pmsg, path_options);
if (!json_parser_extract(self, jso, *pmsg))
{
msg_error("Error extracting JSON members into LogMessage as the top-level JSON object is not an object",
evt_tag_str ("input", input),
NULL);
json_object_put(jso);
return FALSE;
}
json_object_put(jso);
return TRUE;
}
```