[MDEV-17879] Add support for MariaDB audit plugin to produce JSON format Created: 2018-11-30 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Plugin - Audit |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major |
| Reporter: | Nilnandan Joshi | Assignee: | Alexey Botchkov |
| Resolution: | Unresolved | Votes: | 5 |
| Labels: | audit-plugin | ||
| Description |
|
Hi Team, Can you add feature for MariaDB audit plugin to produce JSON log format ? Regards, |
| Comments |
| Comment by Valerii Kravchuk [ 2018-11-30 ] | |||||||||||||||
|
Additionally make sure JSON messages are UTF8 encoded (as this is expected by many readers), no matter for charset is used from MariaDB server side. We may have to add option like: server_audit_output_charset to take this into account. | |||||||||||||||
| Comment by Nilnandan Joshi [ 2018-11-30 ] | |||||||||||||||
|
Also, it would be helpful if current CSV-type format can be changed. Current csv-type file format is simple, but it's still painful to parse, because | |||||||||||||||
| Comment by akrus [ 2019-05-03 ] | |||||||||||||||
|
Would be nice to have this feature. | |||||||||||||||
| Comment by Alexey Botchkov [ 2023-06-14 ] | |||||||||||||||
|
We have two existing JSON formats - the MySQL format and the Percona one. https://dev.mysql.com/doc/refman/8.0/en/audit-log-file-formats.html#audit-log-file-json-format Along with the request about CSV i'd propose to make formats flexible - add variables to specify the list of columns (for CSV) and keys (for the JSON) that appear in the log. Excluding the data that is not needed can save the space, and we also can provide additional information that is not shown in those Oracle/Percona's logs. | |||||||||||||||
| Comment by Michael Widenius [ 2023-06-15 ] | |||||||||||||||
|
I would be good to have a similar format as Percona server as this would allow easier usage with their PMM monitor: Here is an example of one of their records:
| |||||||||||||||
| Comment by Sergei Golubchik [ 2023-06-17 ] | |||||||||||||||
|
holyfoot, if it's flexible, how would you let user to define the format? in what way? using what syntax? |