type.inbound
// two distinct paths
and length(distinct(map(filter(body.links,
.href_url.domain.domain == "storage.googleapis.com"
),
.href_url.path
)
)
) == 2
// they are exactly /<bucket>/index or /<bucket>/unsub
and all(distinct(map(filter(body.links,
.href_url.domain.domain == "storage.googleapis.com"
),
.href_url.path
)
),
regex.imatch(., '/[^/]+/(?:index|unsubv?)')
)
// all within the same bucket
and length(distinct(map(filter(body.links,
.href_url.domain.domain == "storage.googleapis.com"
),
regex.extract(.href_url.path, '^/(?P<bucket>[^/]+)/')[0].named_groups["bucket"]
)
)
) == 1
Playground
Test against your own EMLs or sample data.