Forum Discussion
Irule to laod balance based on soap session ID
Hi
I have a request to search a soap message for the session ID. Based on the first 2 values in the ID I will then need to send the request to a pool member. Below is an example of the message. If the starts with 01 then go to pool member 1. If the starts with 02 then go to pool member 2. if there is no 01 or 02 then load balance normally(round robin) across the 2 servers .
Any assistance will be helpful
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">http://www.eskom.co.za/IAM_MyEskom/">MYCOMPACUST01S1441888421150m4j07NyGit506Z377zDe81FHkA0U0yO9iibnFXUN8852755my@gmail.com
4 Replies
- Malcolm_Sydney1
Nimbostratus
Hi
I have a request to search a soap message for the session ID. Based on the first 2 values in the ID I will then need to send the request to a pool member. Below is an example of the message. If the starts with 01 then go to pool member 1. If the starts with 02 then go to pool member 2. if there is no 01 or 02 then load balance normally(round robin) across the 2 servers .
Any assistance will be helpful
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">http://www.eskom.co.za/IAM_MyEskom/">MYCOMPACUST01S1441888421150m4j07NyGit506Z377zDe81FHkA0U0yO9iibnFXUN8852755my@gmail.com
- Malcolm_Sydney1
Nimbostratus
MYCOMPACUST01S1441888421150m4j07NyGit506Z377zDe81FHkA0U0yO9iibnFXUN8852755my@gmail.com
- Michael_Jenkins
Cirrostratus
You would probably need to do something with HTTP::collect to get the payload so you can search it and find the string.
Collect a request payload when HTTP_REQUEST { if {[HTTP::method] eq "POST"}{ Trigger collection for up to 1MB of data if {[HTTP::header "Content-Length"] ne "" && [HTTP::header "Content-Length"] <= 1048576}{ set content_length [HTTP::header "Content-Length"] } else { set content_length 1048576 } Check if $content_length is not set to 0 if { $content_length > 0} { HTTP::collect $content_length } } } when HTTP_REQUEST_DATA { do stuff with the payload set payload [HTTP::payload] }From there, you would want to manually specify the pool member to route the request to (see here). Something like this in the HTTP_REQUEST_DATA event:
if { $payload contains "01" } { node 10.0.0.1 80 } else if {$payload contains "02"} { I forget if it's "elseif" or "else if" node 10.0.0.2 80 }Then, if you don't have either, it'll load balance as normal.
- IheartF5_45022
Nacreous
There's an XML profile you can use see link https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_implementation/sol_xml_cbr.html. It's for v10.x but I believe still applies in 11.x.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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