1

I'm having a difficult time locating the log file to download. When running

show global variables like '%slow%';

I can see it is located

/mysql/logs/slow.log

When I log into the instance though that path doesn't exist. Any ideas?

This is through google cloud sql and using mysql as the db.

1 Answer 1

0

After a lot of digging I found an answer. It is not perfect as the quality of data may need some massaging, but it works.

gcloud logging read projects/yourproject/logs/cloudsql.googleapis.com%2Fmysql-slow.log --format json| jq -rnc --stream 'fromstream(1|truncate_stream(inputs)) | .textPayload' > slow-log-timestamp.log

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.