Forum Discussion
amolari
Cirrostratus
Jan 29, 2015apm irule, unexpected result - variable scope not standard?
I have the following iRule
when RULE_INIT {
set entrypoint "/Reports/Pages/ReportViewer.aspx?%2fWelcome&rs:Command=Render"
set backend_host "aa.bbb.com"
}
when ACCESS_POLICY_COMPLETED {
...
Michael_Jenkins
Cirrostratus
Jan 29, 2015Firstly, to get an understanding of the flow, you can check out this article describing the APM event flow. Because you won't have a single request that ends up hitting both
ACCESS_POLICY_COMPLETED and ACCESS_ACL_ALLOWED, you can't share variables between them (since variables live and die with the request). Session variables are more persistent and can be accessed as throughout the session. I think that should help answer your first question.
For your second question, RULE_INIT sets a variable when you save the iRule, so it's a global variable. Try changing your irule to use
set ::entrypoint and set ::backend_host instead and then reference them the same way (e.g. HTTP::uri $::entrypoint ). See if that helps.Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
