Forum Discussion
NoamRotter_1534
Nimbostratus
Jan 12, 2017APM variable assign and if statement
I want to change a variable caught by the APM.
The current var: session.logon.last.domain = local.domain
I want to replace it if the session.logon.last.domain is local.domain to somethin...
Kai_Wilke
MVP
Jan 12, 2017Hi Noam,
the best way to check and selectively transform the requested APM session variable, is to use a Variable Assign action item in VPE containing some custom TCL code.
Variable Assign Action
- Name: Transform_Logon_Domain* Type: Custom Variable
- Mode: Unsecure
- Variable Name: session.logon.last.domain
- Expression :
set current_domain [mcget {session.logon.last.domain}] ;
if { $current_domain equals "local.domain" } then {
return "abc.remote" ;
} else {
return $current_domain ;
} ;
Note: You can also check the domain name with an branch rule and trigger the variable assign action only if "local.domain" is currently selected. This will eliminate the else part of the expression, but on the other hand may clutter the policy little more. In the end both methods will work out, so its up to you...
Cheers, Kai
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