Forum Discussion
New to iRules and Tcl
I'm new to iRules, and tcl. I have two url's blabla.test.com and blabla1.test.com, that resolve to the same IP address. My customer wants blabla1 to only go to one private ip address, and blabla to loadbalance between two private ip addresses. I created two pools for this purpose, and wrote the following rule:
when HTTP_REQUEST {
if { [HTTP::uri] contains "blabla1.test.net" } {
pool test1_pool
} else {
pool test_pool
}
}
Unfortunately, everything falls through to the second pool, even uri's with blabla1 in them. I've tried various combinations of syntax, but can't get the first statement to be recognized. Any advice?
Thanks in advance,
John Jenkins
3 Replies
- What_Lies_Bene1
Cirrostratus
Welcome John. Try this - with '.com' - took me a while to spot that!
when HTTP_REQUEST { if { [HTTP::host] equals "blabla1.test.com" } { pool test1_pool } else { pool test_pool } }
- jjenkins334_439
Nimbostratus
Thanks, I'll give that a try. The .com vs. .net thing was actually just a fat finger on my part, a result of rushing because my wife was standing at the door waiting on me. It should have all been .net.
- What_Lies_Bene1
Cirrostratus
No worries. Let us know how you get on.
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