HTTP_REQUEST_SEND is a serverside context event. You can use the clientside command to run commands in the clientside context for a serverside event.
But in this case, you could use priority to log the updated [HTTP::request] value:
when HTTP_REQUEST {
log local0. "Pre: [HTTP::request]"
}
when HTTP_REQUEST priority 501 {
log local0. "Post: [HTTP::request]"
}
Not needed to log the updated value, but you can use clientside {} to run the command in HTTP_REQUEST_SEND
when HTTP_REQUEST_SEND {
clientside {
log local0. [HTTP::request]
}
}
Also note that in 11.0+ HTTP:: get commands show updated values within the same event, if they’ve been updated.
Sorry, you can actually run HTTP::request in HTTP_REQUEST_SEND (for most scenarios), but you need to hide it from the parser (set http_req_cmd “HTTP::request”; log local0. [eval $http]).
Regardless, it sounds like Bruce might be trying to log the HTTP request headers before the HTTP profile modifications are performed. This isn’t possible using HTTP:: commands as the HTTP profile actions are performed before HTTP_REQUEST is triggered.
Bruce, can you clarify what you’re trying to accomplish?
I can’t think of a simple, efficient way to do this with HTTP commands in an iRule. Are there other HTTP profile options you’re using besides XFF? If not, maybe you could log the request in HTTP_REQUEST and then insert the XFF after in the iRule?
Actually, as Nitass suggested you could have a frontend VS which doesn’t have any HTTP profile options enabled with a logging iRule that also calls a second VS. You could configure the customized HTTP profile on the second VS.