Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Log retention in Stackdriver GCP

How can I get log retention enabled in GCP Stack-driver. I haven't found any document for configuring log retention. I can see export option in logging section and log ingestion.

like image 233
Rujuta S Avatar asked Aug 21 '18 05:08

Rujuta S


People also ask

How long is data stored in Stackdriver logging?

Stackdriver Logging allows you to retain the logs for 30 days, and gives you a one-click configuration tool to archive data for a longer period in Google Cloud Storage.

How do I view Stackdriver logs?

To access Cloud Logging Logs Explorer, select Tools -> Google Cloud Tools -> Show Stackdriver Logs Explorer. The Google Stackdriver Logging tab opens. Or, you can open the Logs Explorer for a specific project from Google Cloud Explorer by selecting Tools -> Google Cloud Tools -> Google Cloud Explorer.

What is GCP Stackdriver logging?

Stackdriver Logging allows you to store, search, analyze, monitor, and alert on log data and events from Google Cloud Platform and Amazon Web Services. It includes storage for logs, a user interface called the Logs Viewer, and an API to manage logs programmatically.


1 Answers

Log Retention is now POSSIBLE.

Use this documentation for custom retention periods. This can be between 1 day and 3650 days.

gcloud beta logging buckets update _Default --location=global --retention-days=[RETENTION_DAYS]

Explanation:

For each Google Cloud project, Logging automatically creates two logs buckets: _Required and _Default. All logs generated in the project are stored in the _Required and _Default logs buckets, which live in the project that the logs are generated in:

_Required: This bucket holds Admin Activity audit logs, System Event audit logs, and Access Transparency logs, and retains them for 400 days. You aren't charged for the logs stored in _Required, and the retention period of the logs stored here cannot be modified. You cannot delete this bucket.

_Default: This bucket holds all other ingested logs in a Google Cloud project except for the logs held in the _Required bucket. Standard Cloud Logging pricing applies to these logs. Log entries held in the _Default bucket are retained for 30 days, unless you apply custom retention rules.

With custom buckets and the _Default bucket, you can configure custom retention periods for different logs.

enter image description here

like image 124
Keet Sugathadasa Avatar answered Sep 23 '22 03:09

Keet Sugathadasa