Forum Discussion
iRules - How to send HTTP Response to a HTTP Pool by HSL
We want to send both request and response to a HTTP pool via HSL.
We could able to send request succesfully by below iRule
when CLIENT_ACCEPTED {
set hsl_test [HSL::open -proto TCP -pool clone_test_pool]
}
when HTTP_REQUEST_DATA {
set request_cmd "HTTP::request"
when HTTP_REQUEST_DATA {
HSL::send $hsl_test "[eval $request_cmd][HTTP::payload]"
}
But we are not able to send HTTP Response in similar fashion like below.
when HTTP_RESPONSE {
set response_cmd "HTTP::response"
when HTTP_REQUEST_DATA {
HSL::send $hsl_test "[eval $response_cmd][HTTP::payload]"
}
- Andrew-F5
Employee
You can accomplish this task more efficiently without an iRule by using request logging profiles.
Request logging profiles can be configured to log both the request and response,
set response_cmd "HTTP::response" <--- HTTP::response isn't a valid command. There is no equivalent to HTTP::request for response.
when HTTP_REQUEST_DATA <--- This should be the HTTP_RESPONSE_DATA event. https://clouddocs.f5.com/api/irules/HTTP_RESPONSE_DATA.html
I'd encourage you to pursue the request log profile route first unless there is some specific task it cannot complete within the scope of your requirements.
Best,
Andrew
- Shanmuga_Sundar
Nimbostratus
Our use case is we have a Analytic server to analyze both HTTP Request and Response.
We need to clone the traffic to it for some HTTP endpoints.
Currently we cannot tweak existing logging configuration due some restrictions internal to the project . Is there any way we can do this through iRule?.
Thanks for your support.
Recent Discussions
Related Content
* 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