Table: gcp_logging_bucket - Query Google Cloud Platform Logging Buckets using SQL
A Logging Bucket in Google Cloud Platform is a container for logs. They provide a way to organize and control access to logs. These buckets are used to store logs based on retention and storage policies, ensuring that logs are kept and managed efficiently.
Table Usage Guide
The gcp_logging_bucket
table provides insights into Logging Buckets within Google Cloud Platform. As a system administrator, explore bucket-specific details through this table, including location, retention period, and associated metadata. Utilize it to manage and optimize your log data storage, understand your data retention policies, and ensure appropriate access controls are in place.
Examples
Basic info
Explore the lifecycle and retention details of your Google Cloud Platform logging buckets. This can help you understand how long logs are being retained and in what state, assisting in the management and planning of your logging strategy.
select name, lifecycle_state, description, retention_daysfrom gcp_logging_bucket;
select name, lifecycle_state, description, retention_daysfrom gcp_logging_bucket;
List locked buckets
Explore which Google Cloud Platform logging buckets are locked to prevent accidental deletion or alteration of crucial log data. This could be particularly useful for maintaining data security and integrity in your cloud environment.
select name, lockedfrom gcp_logging_bucketwhere locked;
select name, lockedfrom gcp_logging_bucketwhere locked = 1;
Schema for gcp_logging_bucket
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
akas | jsonb | Array of globally unique identifier strings (also known as) for the resource. | |
create_time | timestamp with time zone | The creation timestamp of the bucket. This is not set for any of the default buckets. | |
description | text | Describes this bucket. | |
lifecycle_state | text | The bucket lifecycle state. | |
location | text | = | The GCP multi-region, region, or zone in which the resource is located. |
locked | boolean | Specifies whether the bucket has been locked, or not. The retention period on a locked bucket may not be changed. Locked buckets may only be deleted if they are empty. | |
name | text | = | The resource name of the bucket. |
project | text | =, !=, ~~, ~~*, !~~, !~~* | The GCP Project in which the resource is located. |
retention_days | bigint | Logs will be retained by default for this amount of time, after which they will automatically be deleted. | |
self_link | text | The server-defined URL for the resource. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
title | text | Title of the resource. | |
update_time | timestamp with time zone | The last update timestamp of the bucket. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- gcp
You can pass the configuration to the command with the --config
argument:
steampipe_export_gcp --config '<your_config>' gcp_logging_bucket