Search code examples
google-cloud-platformstackdrivergoogle-cloud-stackdriver

Exporting old logs efficiently


As part of cloud migration effort, in order establish an archive of old logs, I'd like to export all existing logs from Stackdriver.

I know it is possible to export old logs via entries.list as noted in the documentation:

Use the entries.list API method to retrieve your older log entries and use the destination service's API to write the log entries to the export destination.

It appears that gcloud logging read relies on exactly this call, so I can pull all my logs via the following command:

gcloud logging read "logName=projects/my-project/logs/my-entity" --order asc | pv > production-my-entity.logs

However, this is super slow.

Is there a way to download older logs faster, like in bulk or something?


Solution

  • I think at the moment there's no tools for your purpose, and this feature it's only available to store the logs in Cloud Storage, BigQuery, or Cloud Pub/Sub. You can open a feature request in this link: