Forum Discussion
Shruti_Malik_84
Nimbostratus
May 11, 2007iRule to log domainname from http_request and location from http_response
Hi,
Can i write an i-Rule to log in ltm file where i can log domain name from http_request header and location from http_response header
Waiting for reply!!
Regards
Shruti
- The request part is easy, when you say "location from the response header" what exactly do you mean by that? Do you mean the HTTP "Location" header that is returned on a 301 or 302 redirect?
when HTTP_REQUEST { log local0. "Domain: [HTTP::host]" log local0. "URI: [HTTP::uri]" } when HTTP_RESPONSE { if { [HTTP::header exists "Location"] } { log local0. "Location: [HTTP::header Location]" } }
- Shruti_Malik_84
Nimbostratus
Hi Joe, - As far as I know the Location header is specific to 301 and 302 based redirects where it's value is the new location the browser is supposed to request for the updated link. It is not returned for all HTTP responses (if that is what you were expecting). If the supplied rule does not display log the Location header, that is because it a header with the name of "Location" is not returned in the HTTP response. For non-redirect based responses, the only clue on the document location is given by the Request URI.
- Shruti_Malik_84
Nimbostratus
Hi,
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