1

I need to log all the queries on my sql instances, filter those that seem to fetch too many rows and archive it for a period of time.

Doc says

(2) All SQL queries executed on the database instance

about "Data Access audit logs".

So I've set out to enable access audit logs for my cloud sql server.I have checked data read in the audit logs api page as said inhere, but I cannot seem to find it anywhere in the log explorer. I have aleady checked log names for "projects/PROJECT_NAME/logs/cloudaudit.googleapis.com%2Fdata_access" to no use.

What am I missing? what am I doing wrong?

askedFeb 22, 2021 at 2:21
Daniel Kim's user avatar
2
  • Is it in MySQL? And you need to log the query to the Database, not to the Cloud SQL REST API, correct?CommentedFeb 22, 2021 at 8:16
  • @guillaumeblaquiere Yes,It's MySQL and yes, it's quries executed on the db. I was planning to send all query records to Cloud Logging first and then proccessing them on a regular basis. Should I turn to turning general_log on ?CommentedFeb 22, 2021 at 8:29

1 Answer1

2

To view the logs in Cloud Logging you need toactivate the flaggeneral_log in theMySQL flags feature page.

answeredFeb 22, 2021 at 8:45
guillaume blaquiere's user avatar
Sign up to request clarification or add additional context in comments.

2 Comments

What puzzles me is what the doc says. It says “all sql queries” when it talks about data read audit log. Now im thinking I should just go with the genral_log flag on.
If it was Cloud SQL server connected to SSMS, how do we have the logs of operations performed in SSMS in Logs Explorer? The general_log flag which we are talking about is not supported in Cloud SQL for SQL Server.

Your Answer

Sign up orlog in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

By clicking “Post Your Answer”, you agree to ourterms of service and acknowledge you have read ourprivacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.