Forum Discussion
Jack_39703
Nimbostratus
Jul 27, 2009contains? starts_with? equals?
hi there
i have a existing iRule as follow
when HTTP_REQUEST {
if { [HTTP::uri] contains "/123/"} {
pool 123
}
elseif { [HTTP::uri] starts_with "/456/" } {
pool 456
}
else {
pool 789
}
}
But it does not work when using equals instead of contains/starts_with. Can anyone help? Thanks.
Btw, what is the difference between [HTTP::uri] and [HTTP::path]?
- hoolio
Cirrostratus
Hi, - Jack_39703
Nimbostratus
thx for your quick reply - hoolio
Cirrostratus
So which pool would you want a request for /123_456 to go to? - If for some reason "equals" isn't working for you, you might want to try a switch command with glob matching.
when HTTP_REQUEST { switch -glob [HTTP::uri] { "*/123/*" { pool 123 } "/456/*" { pool 456 } default { pool 789 } } }
- Jack_39703
Nimbostratus
/123_456 will go to another new pool pool_123456 - How about this?
when HTTP_REQUEST { switch -glob [HTTP::uri] { "*/123/*" { pool 123 } "/456/*" { pool 456 } "/123_456*" { pool pool_123456 } default { pool 789 } } }
- anthony_102289
Nimbostratus
Hi - Chris_Miller
Altostratus
Posted By anthony@qut on 09/19/2010 06:10 PM - anthony_102289
Nimbostratus
Thanks Chris.
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