Forum Discussion
Combine ACCESS_POLICY_AGENT_EVENT and http_request
Hi!
How to Combine ACCESS_POLICY_AGENT_EVENT and http_request? i get error on this irule:
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "irule_test" }{
when HTTP_REQUEST {
HTTP::header insert "case" [ACCESS::session data get "session.logon.last.username"]
log local0. "case mumber is [ACCESS::session data get "session.logon.last.username"]"
pool Pool_test
}
}
}
Thanks, Aviv Hassidim
6 Replies
- Lucas_Thompson_Historic F5 Account
ACCESS_POLICY_AGENT_EVENT runs in the context of the connection between TMM and the renderer (the little web server that sends the logon pages, etc). Thus, it's not appropriate to set a pool in this context.
If you want to set a pool for a session, use the "Pool Assign" action in the Access Policy.
- Aviv
Cirrus
as u can see in the irule.. the line of pool is in comment. and i getting error. can i use when access_policy_agent_event together with when http_request? - Lucas_Thompson_Historic F5 AccountOK, yes I see you've put one event code block inside another event code block. Don't do that, it doesn't make sense. You need to define the event, then state the code that runs in it. An event doesn't run inside another event. What are you trying to accomplish?
- Aviv
Cirrus
ן want to insert only once the user logon name in the header of specific web page. can u tell me how?
- Aviv
Cirrus
Thanks Lucas. Now i understand i have used this irule and it worked once as i need:
when ACCESS_ACL_ALLOWED { set user [ACCESS::session data get "session.logon.last.username"] HTTP::header insert "X-USERNAME" $user }Thanks,
Aviv Hassidim
- Lucas_Thompson_Historic F5 Account
Yes exactly. ACCESS_ACL_ALLOWED is the event that should be used to manipulate client's requests once the policy is complete and the user is making requests. This exact example is covered also in page 88 of the APM Operations Guide, here:
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
