Forum Discussion
iRule - will this work?
Sorry if this is a stupid question. I'm a novice trying to validate a iRule and looking for expertise kindness / help. Just trying to logout & re-direct if the its a second time visit to a uri pattern. Will the following work?
when HTTP_REQUEST { if { [HTTP::uri] contains "xyz.com"}{ expr { [mcget {session.custom.logpatterncount}]+1}
if {expr { [mcget {session.custom. logpatterncount}] eq [2] }
{ ACCESS::session remove log local0. "hit for logout button" HTTP::redirect "http://www.test.com" } } }
2 Replies
- amolari
Cirrostratus
you cannot manipulate APM session variables directly in the iRule. You have to "import/export" them with command ACCESS::session data set/get
check: sol13296: Changing the value of an access policy session variable using an iRule
- joshygeorge_206
Nimbostratus
Thank you ! Something like below?when HTTP_REQUEST { if { [HTTP::uri] contains "xyz.com"} {
ACCESS::session data set session.temp.logpatterncount [+1]
if {ACCESS::session data get session.temp.logpatterncount eq [2] }
{
ACCESS::session remove log local0. "hit for logout button" HTTP::redirect "http://www.test.com"} } }
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