turbot/gcp_insights

Query: storage_bucket_logging_detail

Usage

powerpipe query gcp_insights.query.storage_bucket_logging_detail

SQL

with logging_bucket as (
select
name,
lifecycle_state,
retention_days,
create_time
from
gcp_logging_bucket
), storage_bucket as (
select
id,
log_bucket,
log_object_prefix
from
gcp_storage_bucket
where
id = split_part($1, '/', 1)
and project = split_part($1, '/', 2)
and log_bucket is not null
)
select
b.log_bucket as "Log Bucket",
b.log_object_prefix as "Log Object Prefix",
l.create_time as "Created Time",
l.retention_days as "Retention Days",
l.lifecycle_state as "Lifecycle State"
from
storage_bucket b,
logging_bucket l
where
b.log_bucket = l.name;

Dashboards

The query is used in the dashboards: