Forum Discussion
Sylvain_85827
Cirrus
Jul 02, 2013Rewrite URL based on selected node for load-balancing
Dears iRules Gurus and community,
Once again I need your help ^^ I'm wondering how to rewrite an URL of HTTP requests (IPP in fact) depending on the node chosen for load-balancing the traffic. ...
nitass
Employee
Jul 11, 2013I don't know why below code caught all the host name between https:// and the next / except the first letter!i understand square brackets treat thing inside as character rather than word. for example, [https] means h, t, p and s characters. so, if hostname starts with one of them, it will be included.
tcl scan
[chars]
The input substring consists of one or more characters in chars. The matching string is stored in the variable. If the first character between the brackets is a ] then it is treated as part of chars rather than the closing bracket for the set. If chars contains a sequence of the form a-b then any character between a and b (inclusive) will match. If the first or last character between the brackets is a -, then it is treated as part of chars rather than indicating a range.
% set uri_old "http://some.domain.com/something"
http://some.domain.com/something
% scan $uri_old {%*[http://|https://]%[^/]} host_old
1
% put $host_old
ome.domain.com
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects