Persistence based on id within XML file
Hello,
I'm trying to build an iRule which is doing universal persistence based on a string within the POST request of an xml file. This xml file contains the string <chatId>xxxxxxxxxxxxxxxx</chatId>. I want to parse the string between <chatId> and </chatId> to use it for persistence. This is necessary because cookie or source address persistence is not working as all requests comes from a single proxy IP and the clients are not supporting cookies. The http header also doesn't contains any data which can be used for persistence.
To get this work I've written the following rule:
when HTTP_REQUEST {
if { (([HTTP::method] equals "POST") and ([HTTP::uri] contains "/chatSession")) } {
HTTP::collect
log local0. "Parsed payload: [HTTP::payload]"
}
}
when HTTP_REQUEST_DATA {
set SESSIONID [findstr [HTTP::payload] "chatId" 1 16]
log local0. "Parsed chatId: $SESSIONID"
persist uie $SESSIONID 120
HTTP::release
}
I've added some log statements to see what is parsed from the request but unforetunately always an empty string is returned in the logfile and the client gets a timeout while trying to access the VIP.
Hope you can help me to get this solved
Many thanks in advance