turbot/oci_insights

Query: oci_vcn_subnet_by_flow_logs

Usage

powerpipe query oci_insights.query.oci_vcn_subnet_by_flow_logs

SQL

with subnet_logs as (
select
s.id as subnet_id,
case
when l.is_enabled is null
or not l.is_enabled then 'disabled'
else 'enabled'
end as flow_logs_configured
from
oci_core_subnet as s
left join oci_logging_log as l on s.id = l.configuration -> 'source' ->> 'resource'
where
s.lifecycle_state <> 'TERMINATED'
)
select
flow_logs_configured,
count(distinct subnet_id)
from
subnet_logs
group by
flow_logs_configured;

Dashboards

The query is used in the dashboards: