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