Audit Log not generating DML statement logs for Cloud-SQL

229 views
Skip to first unread message

Bharath

unread,
Apr 18, 2021, 9:19:16 AM4/18/21
to Google Cloud SQL discuss

I am trying to display audit logs for Cloud-SQL in the stack-driver-console. I have already enabled audit-log for Cloud-SQL in IAM. 

auditlog_enablement.png

I connect to mysql or postgres databases in Cloud-SQL and when I connect these audit logs are displayed in the console.

Screen Shot 2021-04-16 at 9.15.04 PM.png

request: { @type: "type.googleapis.com/google.cloud.sql.v1beta4.SqlInstancesGetRequest" instance: "testpostgres"

But after this if i perform any operation in that particular database like SELECT or INSERT or DELETE, there is no audit-log (data-access) generated for both mysql and postgres. In mysql instance I have set the following database flags

audit_log ON (this is in beta version)

For mysql if i add 1 more flag **general_log** I am able to get those DML statements but they come under a different log **cloudsql.googleapis.com%2Fmysql-general.log** and don't come under audit-logs

Similarly for post-gres these statements come under a different log:

**cloudsql.googleapis.com%2Fpostgres.log**

I am new to this Cloud-SQL so not aware of the logging implemented there. Why no audit logs are generated when any DML is done for the particular database in that Cloud-SQL instance and should I set any other flag for this purpose? Can anyone please help?

Thanks.


David (Cloud Platform Support)

unread,
Apr 19, 2021, 3:42:22 PM4/19/21
to Google Cloud SQL discuss

Hello,

I see you have asked this on Stackoverflow and gotten a response from us. Please continue the interaction within the Stackoverflow post.

Reply all
Reply to author
Forward
0 new messages