Forum Discussion
mburnham_59608
Nimbostratus
Aug 02, 2011Use a variable in REWRITE_RESPONSE_DONE that was set in ACCESS_POLICY_COMPLETED
Hi all,
I would like to use a variable set in ACCESS_POLICY_COMPLETED (as below) in the REWRITE_RESPONSE_DONE event.
when ACCESS_POLICY_COMPLETED {
set targetbaseurl "https://moo.foo.com"
mangle the targetbaseurl into hex encoding for rewrite engine
binary scan $targetbaseurl H* encodedbaseurl
set mangled_url [concat [ACCESS::session data get {session.server.network.protocol}]://[ACCESS::session data get {session.server.network.name}]/f5-w-$encodedbaseurl\$\$[ACCESS::session data get {session.server.landinguri}] ]
log local0. "mangled URL attempt 109: $mangled_url"
-------------------------------------------------------
}
Is this possible?
Thanks much,
Mark
3 Replies
Sort By
- boomchke_11156
Nimbostratus
I've never done that. Have you tried it out? What are you trying to accomplish? - Kevin_Davies_40
Nacreous
If you set a variable it should be available to other iRules on the same VIP for the life of the TCP connection.Easy to test...
when ACCESS_POLICY_COMPLETED {
set testvar "scope-check"
}
when
REWRITE_RESPONSE_DONE {if {[info exists testvar]} {log "testvar=$testvar"}}Check /var/log/ltm for the log entry.
If that doesnt work you could store information using session or tables which is global to the box. See the table command.
- mburnham_59608
Nimbostratus
I didn't realize the "mangled URL" was static. I thought it had to be created each time, so now I just set it as a global variable and use it whenever necessary.
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