Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

Valid Events for HTTP::host

Hi everyone. When I look at the documentation for the HTTP::host command, the valid events listed are: CACHE_REQUEST, HTTP_REQUEST, HTTP_REQUEST_DATA, HTTP_REQUEST_SEND

When I look at the available commands for the HTTP_RESPONSE event, the HTTP::host command is listed.

I have an iRule that contains a switch -glob for both HTTP_REQUEST AND HTTP_RESPONSE but when trying to save it, I get an error under the HTTP_RESPONSE portion of the iRule that says: [command is not valid in current event context (HTTP_RESPONSE)][HTTP::host]

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

retrieving the clientside request HTTP::host is not available in a serverside response event such as HTTP_RESPONSE. Grab it in HTTP_REQUEST, save it as a variable and refer to it in HTTP_RESPONSE

when HTTP_REQUEST {
    host = [HTTP::host]
}
when HTTP_RESPONSE {
    log local0. "My host: $host"
}
0
Comments on this Answer
Comment made 5 days ago by Chris 140

Is there a documentation error then?

0