Forum Discussion
Sake_Blok
May 29, 2012Nimbostratus
Catching HTTP errors
Hi All,
To troubleshoot TCL errors in an iRule I use "catch" to catch the error and log some info to /var/log/ltm. This makes it easier to find the packet data in a network trace.
...
hooleylist
May 31, 2012Cirrostratus
Hi Sake,
These aren't iRule errors so it's not possible to handle them using the iRule catch command. Here's an option for logging large headers. You''ll need to increase the maximum headers limit on the HTTP profile first so the HTTP request will be parsed and the HTTP_REQUEST event will be triggered. Once you identify the large requests using the iRule you can lower the HTTP profile size limit if you want to.
when HTTP_REQUEST {
Check the total HTTP headers size
if {[string length [HTTP::request]] > 10000 }{
Check if the URI is very long
if {[string length [HTTP::uri]] > 1000}{
log local0. "Uri is long. Length [string length [HTTP::uri]], URI: [HTTP::uri]"
Exit this event from this iRule
return
}
Loop through the headers by name
foreach header {[HTTP::header names]} {
Check for a long header value
if {[string length [HTTP::header value $header]] > 1000 } {
log local0. "Header is long. Header Name: $header,\
Length: [string length [HTTP::header value $header]], Value: [HTTP::header value $header]"
Exit this event from this iRule
return
}
}
If we are still here the request was large, but not the URI or any single header.
Log the first 1k bytes of the full request
log local0. "Request is long: [HTTP::request]"
}
}
Aaron
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