Forum Discussion
Amit787
Nimbostratus
Oct 06, 2020Need to forward traffic on specific pool according to uri over 500 urls
Hello
I am having requirement to setup new url "example.com" and when user try to access
"example.com/user1" traffic should be on "pool1"
"example.com/user2" traffic should be on "pool2"
"example.com/user3" traffic should be on "pool3"
.
.
"example.com/user500" traffic should be on "pool500"
Need dynamic way to achieve this, instead of writing 500 lines of code.
Please advice.
Thanks,
Amit
3 Replies
Sort By
Hi Amit,
Can you try this iRule?
when HTTP_REQUEST { if { [HTTP::host] equals "example.com" && [HTTP::uri] matches_regex {\/user[0-9]{1,3}} } { set poolID [string trimleft [HTTP::uri] "/user"] set poolname "pool$poolID" # log local0. "poolname: $poolname" pool $poolname } }
- Amit787
Nimbostratus
Thanks you sooo much "eaa". Solution worked.... :)
- Amit787
Nimbostratus
And thanks a lot for your quick support as well...
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