AN_168028
May 31, 2018Nimbostratus
iRULE to extract domain info from HORIZON VDI BROKER XML
I am surprised.. no one came across with this.. I am trying to read xml broker for Horizon VDI.. and get domain info out of it and redirect based on domain... Following iRULE I have
Code
when HTTP_REQUEST {
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 {
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
}
}
above iRULE is not working I see hit count for HTTP_REQUEST but no HIT count for HTTP_REQUEST_DATA