Closed rewemkris closed 4 months ago
seems that there is a problem when adding these two options in the config **# pgaudit.log_rows: "on" (probably this one causes the problem)
When disabling them i get the correct logoutput with pgaudit as logger
{
"level": "info",
"ts": "2024-04-26T13:10:44+02:00",
"logger": "pgaudit",
"msg": "record",
"logging_pod": "autpgc16test01-development-1",
"record": {
"log_time": "2024-04-26 13:10:44.785 CEST",
"user_name": "postgres",
"database_name": "postgres",
"process_id": "123",
"connection_from": "[local]",
"session_id": "662b8bb4.7b",
"session_line_num": "8",
"command_tag": "GRANT",
"session_start_time": "2024-04-26 13:10:44 CEST",
"virtual_transaction_id": "3/171",
"transaction_id": "755",
"error_severity": "LOG",
"sql_state_code": "00000",
"application_name": "cnpg-instance-manager",
"backend_type": "client backend",
"query_id": "810986036675059406",
"audit": {
"audit_type": "SESSION",
"statement_id": "8",
"substatement_id": "1",
"class": "ROLE",
"command": "GRANT",
"object_type": "FUNCTION",
"statement": "GRANT EXECUTE ON function pg_catalog.pg_read_binary_file(text, bigint, bigint, boolean) TO \"streaming_replica\"",
"parameter": "
I think we don't handle the rows, that's why log_rows
set to on
is not recognised as a pgaudit record 🤔 I'll work on it tomorrow
Is there an existing issue already for this bug?
I have read the troubleshooting guide
I am running a supported version of CloudNativePG
Contact Details
No response
Version
1.23.0
What version of Kubernetes are you using?
1.28
What is your Kubernetes environment?
Cloud: Google GKE
How did you install the operator?
Helm
What happened?
{ "level": "info", "ts": "2024-04-26T10:55:22+02:00", "logger": "postgres", "msg": "record", "logging_pod": "autpgc16dbms01-development-1", "record": { "log_time": "2024-04-26 10:55:22.428 CEST", "user_name": "postgres", "database_name": "postgres", "process_id": "5024", "connection_from": "[local]", "session_id": "662b6bfa.13a0", "session_line_num": "5", "command_tag": "SET", "session_start_time": "2024-04-26 10:55:22 CEST", "virtual_transaction_id": "4/1471", "transaction_id": "0", "error_severity": "LOG", "sql_state_code": "00000", "message": "AUDIT: SESSION,2,1,MISC,SET,,,SET application_name TO cnpg_metrics_exporter,,0",
"application_name": "cnpg_metrics_exporter",
"backend_type": "client backend",
"query_id": "-5293235264903128716"
}
}
The documentation states the fact that pgaudit extension will use the pgaudit logger
Cluster resource
Relevant log output
No response
Code of Conduct