Forum Discussion
ge0ff73_32053
Apr 21, 2015Nimbostratus
Trying to access HTTP::uri from within ACCESS_POLICY_AGENT_EVENT
I'm trying to modify a HTTP::uri within a when ACCESS_POLICY_AGENT_EVENT but it doesn't appear I can use HTTP commands within this block. Is there any way to do this?
thanks,
Geoff
John_Alam_45640
Apr 22, 2015Historic F5 Account
Variables are not shared between HTTP events and ACCESS events.
The original landing uri is saved as a session variable,
session.server.landinguri
So from any APM event you can use
[ACCESS::session data get session.server.landinguri]
you will get the original URI. Since the policy runs at the start of a connection, this variable is probably what you are looking for.
Having said that, he best way to pass the value of a variable between APM and LTM events is to stuff it into the APM policy session variable data structure.
when CLIENT_ACCEPTED {
ACCESS::restrict_irule_events disable
}
when HTTP_REQUEST {
ACCESS::session data set session.http_uri [HTTP::uri]
}
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "do_it_now_or_never" } {
set uri [ACCESS::session data get session.http_uri]
}
}
HTH.
- John_Alam_45640Apr 22, 2015Historic F5 AccountI should clarify some things: The string "do_it_now_or_never" is a label you enter in the VPE to identify the location within the flow chart where you called the iRule Event from. This is yours to define. Stuffing and retrieving a value is session variables data structure is done via the commands: "ACCESS::session data set" and "ACCESS::session data get".
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects