turbot/oci_insights

Query: objectstorage_bucket_logging_status

Usage

powerpipe query oci_insights.query.objectstorage_bucket_logging_status

SQL

with name_with_region as (
select
concat(configuration -> 'source' ->> 'resource', region) as name_with_region,
is_enabled
from
oci_logging_log
where
lifecycle_state = 'ACTIVE'
),
logging_stat as (
select
case
when not n.is_enabled or n.is_enabled is null then 'disabled'
else 'enabled'
end as logging_stat
from
oci_objectstorage_bucket as b
left join name_with_region as n on concat(b.name, b.region) = n.name_with_region
)
select
logging_stat,
count(*)
from
logging_stat
group by
logging_stat;

Dashboards

The query is used in the dashboards: