Forum Discussion
APM VPE: Matching multiple values against a session variable
Within APM 11.4.0, I'm using an expression to check if the user's domain matches a value with the syntax:
expr { [string tolower [mcget {session.logon.last.domain}]] equals "domain.com" }
If I wanted to check against multiple values, is this the only correct expression:
expr { [string tolower [mcget {session.logon.last.domain}]] equals "domain.com" || [string tolower [mcget {session.logon.last.domain}]] equals "domain.corp"}
Is there a 'simpler' way to represent this? For example:
expr { [string tolower [mcget {session.logon.last.domain}]] equals "domain.com" or “domain.corp” }
I've tried multiple combinations, but it always results in a parsing error.
Thanks!
3 Replies
- wonsoo_41223Historic F5 Account
It is possible to use set command, and it can reduce long iterating command.
set d [string tolower [mcget {session.logon.last.domain}]]
expr { $d eq "domain1.com" || $d eq "domain2.com" || $d eq "domain3.com"}
- speedbird_86757
Nimbostratus
Hi wonsoo,
Thanks for the reply, but it does not seem to work.
This works fine:
set d [string tolower [mcget {session.logon.last.domain}]] expr {$d eq "domain1.com"}
But, if I try with:
set d [string tolower [mcget {session.logon.last.domain}]] expr {$d eq "domain1.com" || $d eq "domain2.com"}
The APM does not match the logon attempt with either domain1.com or domain2.com
Thanks!
- Tyrfau_323703
Nimbostratus
Came across this thread rather late but I hope I can be forgiven as I am still very new to the f5. This snippet worked for me on 12.1.2 when used in a VPE branch rule:
set d [string tolower [mcget {session.logon.last.domain}]]expr {($d eq "domain1") or ($d eq "domain2")}Maybe each
needs to have it's own brackets.$d eq "text"
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