Forum Discussion
4 Replies
Sort By
- zeiss_63263Historic F5 Account
Hi,
It sounds like you want an iRule to fire on a Response event and collect some part of the payload or headers (in HTTP for example). The iRule event and actions depend on the protocol and profiles in use. We couldn't advise anything more specific without knowing what your traffic is and where the data is in the payload you want to inspect.
Michael.
- goldi_247196NimbostratusHi Michael, We are trying to write a iRule for the BIG-IP universal persistence module. Our mission is to extract and persist from a HTTP response payload/body an application unique identifier (something like a seesionid for us). Then use it in a consecutive HTTP requests. Note, this unique identifier return in text/xml/soap-xml response formats and there is no cookie involve here. We're having problem to write the TCL code for the extraction of our custom unique identifier from the HTTP response payload/body. We have checked these manuals and did not find example for this kind of functionality: https://clouddocs.f5.com/api/irules/HTTP_RESPONSE.html https://clouddocs.f5.com/api/irules/HTTP__payload.html https://clouddocs.f5.com/api/irules/HTTP_RESPONSE_DATA.html https://clouddocs.f5.com/api/irules/HTTP__collect.html https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_configuration_guide_10_0_0/ltm_rules.html1197203 can you help? Thanks. goldi F5 iRule for UIE - Extracting a value from HTTP response payload/body
- goldi_247196NimbostratusHi, We are trying to write a iRule for the BIG-IP universal persistence module. Our mission is to extract and persist from a HTTP response payload/body an application unique identifier (something like a seesionid for us). Then use it in a consecutive HTTP requests. Note, this unique identifier return in text/xml/soap-xml response formats and there is no cookie involve here. We're having problem to write the TCL code for the extraction of our custom unique identifier from the HTTP response payload/body. We have checked these manuals and did not find example for this kind of functionality: https://clouddocs.f5.com/api/irules/HTTP_RESPONSE.html https://clouddocs.f5.com/api/irules/HTTP__payload.html https://clouddocs.f5.com/api/irules/HTTP_RESPONSE_DATA.html https://clouddocs.f5.com/api/irules/HTTP__collect.html https://support.f5.com/kb/en-us/products/big-ip_ltm/manuals/product/ltm_configuration_guide_10_0_0/ltm_rules.html1197203 can you help? Thanks. F5 iRule for UIE - Extracting a value from HTTP response payload/body
- Stanislas_Piro2Cumulonimbus
Try this irule:
when HTTP_RESPONSE { Trigger collection for up to 1MB of data if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{ set content_length [HTTP::header "Content-Length"] } else { set content_length 1048576 } Check if $content_length is not set to 0 if { ([HTTP::status] == 200) && ($content_length > 0)} { HTTP::collect $content_length } } when HTTP_RESPONSE_DATA { do stuff with the payload find the application unique identifier between and (5 is the length of string) persist add uie [string trim [findstr [HTTP::payload] "" 5 ""]] } when HTTP_REQUEST { persist uie [string trim [findstr [HTTP::payload] "" 5 ""]] }