Insert text to HTTP header via iRule event during APM execution
Hi Community Members,
We are trying to insert some text to HTTP header through an iRule which will check for ACCESS_POLICY_AGENT_EVENT generated by via iRule event during an APM checking.
Event "event_1" is getting generated via APM. There is below iRule that is doing the header injection if "event_1" is generated.
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "event_1" } {
HTTP::header insert "my_text" value
}
}
But in our checking it was found that the header injection during APM execution by an iRule is not working.
Below F5 article also mentions the similar thing:
https://support.f5.com/csp/article/K22055705
Is there a way out by which we can still insert the desired text, value combination to HTTP header?
Any leads would be helpful. Thanks!
Cheers,
Bharat
HTTP_REQUEST_SEND is also one of the event can be used to send the APM variable.
https://support.f5.com/csp/article/K74392192
so worth trying below. modify as needed.
when ACCESS_POLICY_AGENT_EVENT { if { [ACCESS::policy agent_id] eq "event_1" } { ACCESS::session data set session.custom.header "value" set header [ACCESS::session data get "session.custom.header"] } } when HTTP_REQUEST_SEND { clientside { if {[info exists header]}{ HTTP::header insert "headername" $header } else { return } } }