pgauditlogtofile icon indicating copy to clipboard operation
pgauditlogtofile copied to clipboard

Error while parsing produced CSV-File cause of newline in field "context"

Open fomp opened this issue 1 year ago • 0 comments

We have a case of an unparseable record. The cause is a newline in the context field. In this case the value should be quoted:

2024-07-02 14:35:45.889 CEST,testuser,mydb,1802610,192.168.12.3:56212,6672ce6e.1b8172,1,SELECT,2024-07-02 14:26:22 CEST,28/2357857,0,00000,OBJECT,1,1,WRITE,INSERT,TABLE,pgaudittest.testtable,"INSERT INTO testtable (name, age) VALUES ('Julia', 28)",<none>,,,,,SQL statement "INSERT INTO testtable (name, age) VALUES ('Julia', 28)"
PL/pgSQL function pgaudittest.fill_table() line 3 at SQL statement,,,,psql

We would rather expect the following string for the value of "context":

"SQL statement ""INSERT INTO testtable (name, age) VALUES ('Julia', 28)""
PL/pgSQL function pgaudittest.fill_table() line 3 at SQL statement"

Versions are: pgauditlogtofile 1.5.7 pgaudit 1.4.3 postgres is 12.18

fomp avatar Jul 03 '24 09:07 fomp