Forum Discussion
KT_271103
Nimbostratus
Sep 21, 2016Irule expaination
Hi,
Can anyone explain below irule code
when HTTP_REQUEST {
set pool_nm "web_8080_"
set key [expr {[crc32 [substr [HTTP::uri] 0 "?"]] % 3}]
append pool_nm $key
if { [active_memb...
Vijay_E
Cirrus
Sep 21, 2016Gist:
You should be having multiple pools that start with "web_8080_{some-value-here}". Traffic is sent to the pool identified by "web_8080_{some-value-here}" if there are available members and if not, to the pool: web_proxy
A bit more detail:
[substr [HTTP::uri] 0 "?"] - if you have a string like this in the URI:
/index.jsp?user=test&login=check - /index.jsp will be the answer and this will be subjected to crc32 and then the remainder of the value when divided by 3 is used as "key" which is then used as "{some-value-here}" in the pool name as noted in the 1st line of this comment.
when HTTP_REQUEST {
set pool_nm "web_8080_"
set key [expr {[crc32 [substr [HTTP::uri] 0 "?"]] % 3}]
append pool_nm $key
if { [active_members "$pool_nm"] } {
pool "$pool_nm"
} else { pool web_proxy
}
}
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