Using http-request set-uri

I am migrating from on-prem sentry to cloud. I want to use HAProxy to map DSNs and redirect traffic to cloud while code is updated to replace old DSNs with new ones. I have a long list of DSN mappings like

123@sentry.onprem.io/abc -> 456@ingest.sentry.io/def
789@sentry.onprem.io/ghi -> 012@ingest.sentry.io/jkl

first DSN being old on-prem and second being corresponding cloud DSN

I am trying to use something along the lines of

http-request set-uri http://456@ingest.sentry.io/def if { url http://123@sentry.onprem.io/abc }
http-request set-uri http://012@ingest.sentry.io/jkl if { url http://789@sentry.onprem.io/ghi }

and so on for very many DSN pairs. I want to match the entire DSN and replace it with another. Both being different and each pair being unique

I am aware of GOReplay but it has its own limitations and I want to explore HAProxy route.

Questions:
Is this approach a good idea?

I’m having trouble finding documentation for syntax of if clause. Anyone got link handy? Closest I’ve found so far is this one. Is the syntax above correct? haproxy -c does not complain about it.

Any thoughts on what would be good approach to doing this?