Forum Discussion
ims_243721
Sep 08, 2016Nimbostratus
Irule latency
Hi
I developed irule to inspect session id and perform persistence but calculating time it might take up to 30 seconds to do this, Is there anyway to reduce the time and how can i know reason of t...
Stanislas_Piro2
Sep 08, 2016Cumulonimbus
Hi,
I think the problem is you collect 3000 bytes even if the content length is less than 3000.
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 resp_content_length [HTTP::header "Content-Length"]
} else {
set resp_content_length 1048576
}
Check if $content_length is not set to 0
if { ([HTTP::status] == 200) && ($resp_content_length > 0)} {
HTTP::collect $resp_content_length
}
}
when HTTP_RESPONSE_DATA {
do stuff with the payload
find the application unique identifier between and (11 is the length of string)
persist add uie [string trim [findstr [HTTP::payload] "" 11 ""]]
}
when HTTP_REQUEST {
Trigger collection for up to 1MB of data
if {[HTTP::header exists "Content-Length"] && [HTTP::header "Content-Length"] <= 1048576}{
set req_content_length [HTTP::header "Content-Length"]
} else {
set req_content_length 1048576
}
Check if $content_length is not set to 0
if { ($req_content_length > 0)} {
HTTP::collect $req_content_length
}
HTTP::header remove "Accept-Encoding"
}
when HTTP_REQUEST_DATA {
do stuff with the payload
find the application unique identifier between and (11 is the length of string)
persist uie [string trim [findstr [HTTP::payload] "" 11 ""]]
}
the
string trim
command remove space and new lines characters that can be added in XML format.Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects