turbot/aws_insights

Query: kinesis_streams_for_cloudwatch_log_group

Usage

powerpipe query aws_insights.query.kinesis_streams_for_cloudwatch_log_group

SQL

with filtered_log_group as (
select
name,
region,
account_id
from
aws_cloudwatch_log_group
where
arn = $1
and region = split_part($1, ':', 4)
and account_id = split_part($1, ':', 5)
),
matching_subscription_filters as (
select
f.destination_arn
from
aws_cloudwatch_log_subscription_filter f
join
filtered_log_group g on g.name = f.log_group_name
where
f.region = split_part($1, ':', 4)
and g.account_id = split_part($1, ':', 5)
)
select
s.stream_arn
from
aws_kinesis_stream s
join
matching_subscription_filters msf on s.stream_arn = msf.destination_arn
where
s.account_id = split_part($1, ':', 5)
and s.region = split_part($1, ':', 4);