Forum Discussion
Malcolm_Sydney1
Nimbostratus
Oct 01, 2015Irule 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. ...
Michael_Jenkins
Cirrostratus
Oct 01, 2015You 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.
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