Forum Discussion
Jun 01, 2018
Try adding some logging to the iRule to see if the URI, METHOD and Content-Length matches. I tested your iRule and in my lab it triggers the HTTP_REQUEST_DATA event.
when HTTP_REQUEST {
log local0. "uri: [HTTP::uri]"
log local0. "method: [HTTP::method]"
log local0. "content-length: [HTTP::header Content-Length]"
if { ( [HTTP::uri] contains "/broker/xml") and ( [HTTP::method] eq "POST")and ([HTTP::header Content-Length] == 395)} {
HTTP::collect [HTTP::header Content-Length]
}
}
when HTTP_REQUEST_DATA {
log local0. "HTTP_REQUEST_DATA triggered"
Parse XML Data
set xmlusername [findstr [HTTP::payload] "username" 22 ""]
set xmldomain [findstr [HTTP::payload] "domain" 22 ""]
log local0. "xmlusername check" $xmlusername
if {($xmlusername contains "user1")} {
HTTP::redirect https://vdi1.abc.com
}
}
Output:
Jun 1 14:28:54 nielsvs-bigip info tmm[13519]: Rule /Common/IRULE_XML : uri: /broker/xml
Jun 1 14:28:54 nielsvs-bigip info tmm[13519]: Rule /Common/IRULE_XML : method: POST
Jun 1 14:28:54 nielsvs-bigip info tmm[13519]: Rule /Common/IRULE_XML : content-length: 395
Jun 1 14:28:54 nielsvs-bigip info tmm[13519]: Rule /Common/IRULE_XML : HTTP_REQUEST_DATA triggered