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.
Now I would like to do the same for HTTP errors like these:
011f0007:3: http_process_state_prepend - Invalid action EV_EGRESS_DATA during ST_HTTP_PREPEND_HEADERS (Client side: vip=VS_HTTP profile=http pool=gateway-http)
011f0007:3: http_process_state_prepend - Invalid action EV_INGRESS_DATA during ST_HTTP_PREPEND_HEADERS (Server side: vip=VS_HTTP profile=http pool=gateway-http)
011f0005:3: HTTP header (33304) exceeded maximum allowed size of 32768 (Client side: vip=VS_HTTP profile=http pool=gateway-http)
Is there a way to detect these errors from within the iRule so that extra logging can be done to help in pinpointing the faulty session.
All tips are welcome! :-)
Cheers,
Sake
- hooleylistCirrostratusHi Sake,
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]" } }
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