Forum Discussion
devrick0_22143
Feb 18, 2010Nimbostratus
uri query question
I am new to irules and hoped someone could lend a hand. The idea behind the irule I am trying to write up is that when a request comes in, the irule pulls out a certain name=value pair and then route...
devrick0_22143
Feb 23, 2010Nimbostratus
Thanks to everyone for offering up alternate methods. I took some bits from the various methods and went this the approach below. We are evaluating its performance now.
when HTTP_REQUEST {
set baseip 10.1.1.
set baseoctet 25
set basepool app_pool_1
set modulus 2
set uri [string map {?rx ?XXX-rx &rx &XXX-rx} [HTTP::uri]]
set key [URI::query $uri XXX-rx]
if {$key != ""} {
set maxkey [expr {$key + $modulus}]
for { set i $key } { $i < $maxkey} { incr i } {
set key [expr {$i % $modulus}]
set newoctet [expr {$baseoctet + $key}]
set memberip "$baseip$newoctet"
log local0.info "uri: $uri"
log local0.info "key: $key"
log local0.info "memberip: $memberip"
if { [LB::status pool $basepool member $memberip 80 ] eq "up" }{
pool $basepool member $memberip:80
return
}
}
reject
}
}
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