Forum Discussion
SergioG_133218
Nimbostratus
Sep 12, 2014How to select pool based on http payload ...
Dears
I want to know if posible to follow ... The developers guys send via http to f5 some data ,this guys want to f5 select the pool based on http payload .
For example ...
Address: h...
cjunior
Nacreous
Sep 12, 2014Hello, I follow the following reasoning, trying to avoid regex for example. Of course the code is very simple and needs validation source page, size of request, if there is content, etc. But I think this code is a start for you.
Regards.
when HTTP_REQUEST {
if { ([HTTP::method] eq "POST") } {
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_REQUEST_DATA {
set decoded [decode_uri [HTTP::payload]]
log local0. "=== Decoded $decoded"
set ini [string first "\"idTerminal\"" $decoded]
if { $ini != -1 } {
set end [string first "," $decoded $ini]
set value [string range $decoded $ini [expr {$end-1}]]
set idTerminal [lindex [split $value ":"] 1]
switch -exact $idTerminal {
678 -
679 {
pool terminal_67x_pool
}
default {
pool default_pool
}
}
}
}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
