Forum Discussion
Yaba_330342
Nimbostratus
Oct 23, 2018Set portion of variable to two seperate variables
Hi guys,
I was asking to manipulate a session variable in APM
There is a variable with full name (something like John Cooper)
Take the last name and set it to session.ad.last.attr.firstname
Take...
Kevin_Stewart
Employee
Oct 23, 2018As long as you're sure there's always only one space in the string, you could use a simple split to turn the values into a list:
when ACCESS_POLICY_AGENT_EVENT {
if {[ACCESS::policy agent_id] eq "aid_irule_EXTRACT-FIRST-LAST-NAME" } {
set name [split [ACCESS::session data get session.ad.last.attr.displayname] " "]
ACCESS::session data set session.ad.last.attr.firstname [lindex ${name} 0]
ACCESS::session data set session.ad.last.attr.lastname [lindex ${name} 1]
}
}
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