type.inbound
and any(filter(body.links,
strings.iends_with(.href_url.path, '/link.html')
and .href_url.fragment is not null
),
ml.link_analysis(.).submitted
and length(ml.link_analysis(.).redirect_history) > 1
and any(ml.link_analysis(.).redirect_history,
strings.contains(.path, ..href_url.fragment)
)
)
Playground
Test against your own EMLs or sample data.