My F5 Irule- Need some help
Below are some of the content of our HTTP body and we are trying to parse and filter out auth token from HTTP response for persistence.we have added below irule.
{"username":"XStore24User","authToken":"87cd528d-fa28-43f7-b11c-c9bed53d0e4b","validityPeriod":3600000,"clientId":"phonetop-device","clientHost":"10.80.15.42","clientAddress":"10.80.15.42","creationTimestamp":1456550435252,"logConfig":{"clientId":"phonetop-
when HTTP_RESPONSE {
trigger collection for up to 1MB of data
if {([HTTP::header exists "Content-Length"]) && ([HTTP::header "Content-Length"] <= 1000000)}{
set content_length [HTTP::header "Content-Length"]
} else {
set content_length 1000000
}
HTTP::collect $content_length
}
when HTTP_RESPONSE_DATA {
if {[HTTP::payload] contains "authToken"} {
set authToken [findstr [HTTP::payload] "authToken" 12 "36"]
persist add uie $authToken
}
HTTP::release
}
Now am able to extract the 1MB data ,but after collecting it's not able to read the payload and extract my authtoken.
I put some print message to see if I can list some payload data but its shows some content in binary format in /var/log/ltm. I tried with content length as 100 and still got the same error.
Could you please let me know if there is any thing am missing in my irule.
Thanks, Akhi