Forum Discussion
generic iRULE to only replace links which have .subdmain.com from http to https
Hi All,
I am newbie on iRule and F5 and still learning about it. I had an issue lately and want to get more ideas that could help.
Problem:
I have an iRULE to change any http to https using stream::expression {@http@https@}. But, when get a webservice response the link referencing 'http://schemas.xmlsoap.org/' is changed to https. And thats makes it an invalid link and raise an application exception as the application expects 'http://schemas.xmlsoap.org/' not https.
I've tried this but didn't work STREAM:EXPRESSION {@http://(.{1,9}.subdomain.com)@https://\1@} but it didn't work(my URL changed from http://client1.subdomain.com to https://\1) because it seams that stream expression doesn't accept backrefrence (to call back the string matched by the regexp in the parenthesis). I am trying to make a generic rule as we have couple of clients and don't want to make a rule of each client (the link to the application would be e.g client1.subdomain.com).
I've tried to only omit schemas.xmlsoap.org by using the following expression: STREAM:EXPRESSION {@http://(?!schemas.xmlsoap.org)@https@} but it didn't work neither and every thing have change to https even https://schemas.xmlsoap.org.
Any ideas and suggestion are appreciated.
May be can try this:
STREAM::expression {@http://@https://@ @http://schemas@http://schemas@}
8 Replies
- JG
Cumulonimbus
STREAM supports only "basic regex" only. See LTM stream profile: Multiple replacements & regular expressions. I suspect that one of the reasons F5 does not want to give us anything better than that is that that could use too much memory, in the context of product-line control. Memory is cheap these days, but you just can't add more to an "appliance".
- kunjan
Nimbostratus
May be can try this:
STREAM::expression {@http://@https://@ @http://schemas@http://schemas@}- JG
Cumulonimbus
I thought a string could be matched only once with STREAM. - andrew_05_16419
Nimbostratus
I seams a very good solution as I have more than one link to ignore. STREAM::expression {@http://@https://@ @http://site1@http://site1@ @http://site2@http://site2@} I am gonna give it a try later this week because I don't have access to the administration interface and the person in charge is on leave this week. It is unfortunate that there is no emulator for iRULE that we could use to test.
- kunjan_118660
Cumulonimbus
May be can try this:
STREAM::expression {@http://@https://@ @http://schemas@http://schemas@}- JG
Cumulonimbus
I thought a string could be matched only once with STREAM. - andrew_05_16419
Nimbostratus
I seams a very good solution as I have more than one link to ignore. STREAM::expression {@http://@https://@ @http://site1@http://site1@ @http://site2@http://site2@} I am gonna give it a try later this week because I don't have access to the administration interface and the person in charge is on leave this week. It is unfortunate that there is no emulator for iRULE that we could use to test.
- kunjan
Nimbostratus
The most specific regex is matched.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com