MySQL Forums
Forum List  »  Security

MySQL Enterprise Audit - JSON Trailing commas
Posted by: Herman Engström
Date: March 08, 2021 09:32AM

When using MySQL Enterprise Audit and using JSON as output format there seems to be a final trailing comma. I processed the JSON in jsonformatter which confirms this, otherwise the JSON structure is ok.

I am trying to read this file with an external component and but it generates a parsning error due to the final comma (see example below) after each JSON document.

I could remove this comma with script but I would perfer not to.

Is it possible to configure MySQL to not generate this commma?

Example of generated MySQL Enterprise Audit log:
[{ "timestamp": "2020-12-31 20:00:01", "id": 0, "class": "connection", "event": "connect", "connection_id": 12, "account": { "user": "USER", "host": "localhost" }, "login": { "user": "USER", "os": "", "ip": "", "proxy": "" }, "connection_data": { "connection_type": "socket", "status": 0, "db": "", "connection_attributes": { "_pid": "28031", "_platform": "x86_64", "_os": "XXXX", "_client_name": "libmysql", "os_user": "USER", "_client_version": "8.0.20" } } },
{ "timestamp": "2020-12-29 20:00:02", "id": 2, "class": "general", "event": "status", "connection_id": 10, "account": { "user": "USER", "host": "localhost" }, "login": { "user": "USER", "os": "", "ip": "", "proxy": "" }, "general_data": { "command": "Query", "sql_command": "alter_instance", "query": "ALTER INSTANCE", "status": 0 } },]

Options: ReplyQuote


Subject
Views
Written By
Posted
MySQL Enterprise Audit - JSON Trailing commas
935
March 08, 2021 09:32AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.