Forum Discussion
Al-Mutlaq_21911
Nimbostratus
Aug 26, 2015direct traffic based on information from the XML request
Dear All,
I need a solution on IRULE for example to solve the following scenario:
I have 10 servers that will receive XML requests. the unique ID in each XML request will be a number such ...
Stanislas_Piro2
Cumulonimbus
Dec 21, 2015I don't understand what is wrong on the updated irule...
I tested it successfully...
Can you try this irule and update with the last /var/log/ltm lines...
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
when HTTP_REQUEST {
set msisdn [URI::decode [URI::query [HTTP::uri] msisdn]]
if {[string length $msisdn] } {
switch -glob $msisdn {
"*0" { set ports {8080 8180 8280 8380 8480 8580 8680 8780 8880 8980}}
"*1" { set ports {8180 8080 8380 8280 8580 8480 8780 8680 8980 8880}}
"*2" { set ports {8280 8380 8480 8580 8680 8780 8880 8980 8080 8180}}
"*3" { set ports {8380 8280 8580 8480 8780 8680 8980 8880 8180 8080}}
"*4" { set ports {8480 8580 8680 8780 8880 8980 8080 8180 8280 8380}}
"*5" { set ports {8580 8480 8780 8680 8980 8880 8180 8080 8380 8280}}
"*6" { set ports {8680 8780 8880 8980 8080 8180 8280 8380 8480 8580}}
"*7" { set ports {8780 8680 8980 8880 8180 8080 8380 8280 8580 8480}}
"*8" { set ports {8880 8980 8080 8180 8280 8380 8480 8580 8680 8780}}
"*9" { set ports {8980 8880 8080 8180 8280 8380 8480 8580 8680 8780}}
default { set ports {8080 8180 8080 8180 8480 8580 8680 8780 8880 8980}}
}
} else {set ports {8080 8180 8280 8380 8480 8580 8680 8780 8880 8980}}
foreach port $ports {
if { [LB::status pool $default_pool member 172.24.248.85 $port] eq "up" } {
pool $default_pool member 172.24.248.85 $port
log local0. "id: $msisdn\tselected port: $port"
break
}
}
}
The expected behavior of this irule is to assign pool member port based on the ports list assigned per msisdn parameter.
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
