Exporting old logs from Stackdriver to Bigquery

Viewed 473

I have Stackdriver logs dating back to Sept. 3rd, and a sink I created on Sept. 14th pulling those logs into a Bigquery dataset. Currently, the data in Bigquery starts only from when I created the sink. Can I export previous logs to a giant .csv and then reupload? I found a similar question here, but with no answer.

Thanks, and sorry for not being more technical with my question -- I am new to Stackdriver logging!

2 Answers

As of late 2021, an alpha feature known as copy logs is available, which will allow you to dump older logs into a GCS storage bucket, and from there, it's a short trip back into BigQuery.

As a caveat, this must be done via shell, and as an alpha feature, no guarantees or SLAs are made.

Prior to this feature, you would have been out of luck. Downloading old logs only allowed 10K logs per request.

Since exporting happens for new log entries only, you cannot export log entries that Logging received before your sink was created. Please refer this Documentation

Related