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, 2015In the irule, if the MSISDN is not in query string and content type is not XML, the member is not defined in the irule... the request is load balanced on on of pool members...
I added a else condition in the HTTP_REQUEST event.
when CLIENT_ACCEPTED {
set default_pool [LB::server pool]
}
HTTP_REQUEST {
set msisdn [URI::decode [URI::query [HTTP::uri] msisdn]]
if {[string length $msisdn] } {
switch -glob $msisdn {
"*0" {
if { [LB::status pool $default_pool member 172.24.248.85 8580] eq "up" } {
pool $default_pool member 172.24.248.85 8580
} else {
pool $default_pool member 172.24.248.85 8680
}
}
"*1" {
if { [LB::status pool $default_pool member 172.24.248.85 8680] eq "up" } {
pool $default_pool member 172.24.248.85 8580
} else {
pool $default_pool member 172.24.248.85 8680
}
}
default { pool $default_pool member 172.24.248.85 8080 }
}
} elseif { [HTTP::header Content-Type] contains "xml" } {
HTTP::collect [HTTP::header Content-Length]
} else { pool $default_pool member 172.24.248.85 8080 }
}
when HTTP_REQUEST_DATA {
set msisdn [string trim [findstr [HTTP::payload] "" 8 ""]]
switch -glob $msisdn {
"*0" {
if { [LB::status pool $default_pool member 172.24.248.85 8580] eq "up" } {
pool $default_pool member 172.24.248.85 8580
} else {
pool $default_pool member 172.24.248.85 8680
}
}
"*1" {
if { [LB::status pool $default_pool member 172.24.248.85 8680] eq "up" } {
pool $default_pool member 172.24.248.85 8580
} else {
pool $default_pool member 172.24.248.85 8680
}
}
default { pool $default_pool member 172.24.248.85 8080 }
}
}
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
