Payload string based persistence
1) CLient sent HTTP request with user id and password
2) Server responds with SESSIONID in XML file after successfull login.
3) CLient sent HTTP request with SESSIONID in xml file ecery time
4) Server responds data, but no SESSIOnID
5) Client send HTTP request with SESSIONID in xml file
************************************************************************
when HTTP_RESPONSE {
if {[string length [findstr [HTTP::payload] "<return>" 8 "</return>"]] == 30}
{
set SESSIONID_RS [findstr [HTTP::payload] "<return>" 8 "</return>"]
log local0. "Response SessionID: $SESSIONID_RS"
persist uie add $SESSIONID_RS
else { persist source_address}
}
}
when HTTP_REQUEST {
if {[string length [findstr [HTTP::payload] "<arg0>" 6 "</arg0>"]] == 30}
{
set SESSIONID_RQ [findstr [HTTP::payload] "<arg0>" 6 "</arg0>"]
log local0. "Request SessionID: $SESSIONID_RQ"
persist uie $SESSIONID_RQ
}
}
**************************************************************
We want to create a perssitence rule on the basis of SESSIONID.
I am able to log the sessionID, but persistence is not working. Please suggest
I am new to iRule and Community so attaching iRule in JPEG attachment I cant paste in body(Dont know why?)
Hi Anirban, you will very likely have to start collecting the data and lookup the collected payload in the context of the HTTP_RESPONSE_DATA event.
There is a how-to in the event man page for HTTP_RESPONSE_DATA.
Please make also sure to remove the Accept-Encoding header in the context of HTTP_REQUEST. Header manipulation is described here: HTTP::header. By removing the Accept-Encoding header you prevent the server from sending compressed data.
Please check, if the payload send by the client has the Expect header (Expect: 100). Let me know, if this is the case. I had a similar issue a while ago and may have a solution based on collecting CLIENT_DATA or CLIENTSSL_DATA.