Forum Discussion
F51982_110427
Nimbostratus
Feb 09, 2017APM Values
Is there any documentation on the different values and or good examples of what happens when the data is passed through utilizing the values.
IE:
expr
return
string
session.logon.las...
Kai_Wilke
MVP
Feb 10, 2017Hi F51982,
assuming that
session.ad.last.attr.sAMAccountName is set to DOMAIN\bob the following result can be expected.
mcget {session.ad.last.attr.sAMAccountName} = DOMAIN\bob
string tolower [mcget {session.ad.last.attr.sAMAccountName}] = domain\bob
expr { [mcget {session.ad.last.attr.sAMAccountName}] } = DOMAIN\bob
expr { [string tolower [mcget {session.ad.last.attr.sAMAccountName}]] } = domain\bob
return [mcget {session.ad.last.attr.sAMAccountName}] = DOMAIN\bob
return [string tolower [mcget {session.ad.last.attr.sAMAccountName}]] = domain\bob
The difference of using a native
command, expr { [command] } or return [command] is non-existent if you just fetch an existing variable while passing it to a new variable.
Only the advanced variable assign actions are making the difference between those commands.
Example1:
expr { ( [mcget {session.ad.last.attr.sAMAccountName}] contains "domain\bob" ) or ( [mcget {session.ad.last.attr.sAMAccountName}] contains "domain\tom" ) }
Result: The above example will return the value
if bob or tom is loggin in and 1
for everyone else.0
Example2:
if { ( [mcget {session.ad.last.attr.sAMAccountName}] contains "domain\bob" ) or ( [mcget {session.ad.last.attr.sAMAccountName}] contains "domain\tom" ) } then {
return a ;
} else {
return b ;
} ;
Result: The above example will return the value
if bob or tom is loggin in and a
for everyone else.b
Example3:
set user [mcget {session.ad.last.attr.sAMAccountName}] ;
if { $user starts_with "DOMAIN\\" } then {
return "DOMAIN2\\[lindex [split $user "\\"] 1]" ;
} else {
return $user ;
} ;
Result: The above example will return the
while rewriting sAMAccountName
to DOMAIN\
.DOMAIN2\
Cheers, Kai
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