turbot/azure_insights

Query: security_group_flow_logs

Usage

powerpipe query azure_insights.query.security_group_flow_logs

SQL

with flow_logs as (
select
l ->> 'id' as id
from
azure_network_security_group as nsg,
jsonb_array_elements(flow_logs) as l
where
lower(nsg.id) = $1
and nsg.subscription_id = split_part($1, '/', 3)
)
select
fl.name as "Name",
fl.network_watcher_name as "Network Watcher Name",
fl.enabled as "Enabled",
f.id as "Flow Log ID"
from
flow_logs as f left join azure_network_watcher_flow_log as fl on lower(fl.id) = lower(f.id)
order by
fl.name;

Dashboards

The query is used in the dashboards: