Vinicius Vieira
Vinicius Vieira

Reputation: 11

Extract existing data from Logs Storage

I need to extract the data that was stored in Logs Storage Bucket to store in Cloud Storage.

I know it is possible to perform the storage route, but it is only for new data. I need to extract the data already stored for some time.

Upvotes: 1

Views: 1227

Answers (1)

Alex G
Alex G

Reputation: 1279

There is an experimental feature that enables you to export historical data to Cloud Storage, please see the Copying log entries documentation. Please also be advised that this feature is still on its preview stage. Below are the summarized steps for the process:

  1. Setup appropriate permission and gcloud tool described in “Before you begin” section
  2. Execute the command gcloud logging buckets list to get relevant information to use in future commands
  3. Execute the following command after populating the fields in the brackets.

gcloud alpha logging copy <LOGGING_BUCKET_ID> <CLOUD_STORAGE_BUCKET_NAME> --location= --log-filter= --project=<PROJECT_ID>

After the operation finishes, the historical data for the logs will be in the storage of your choice. The operation results can take some time depending on the size or quantity of the log data.

Upvotes: 1

Related Questions