Forum Discussion
AlexBCT
Aug 06, 2021Cumulonimbus
How to stop an APM variable converting string to number
Hi all, For a specific requirement, I need to add ".0" at the end of a username in APM. I'm doing this using a Variable Assign agent in the VPE. As the username consists completely of number...
AlexBCT
Cumulonimbus
Hi Dario,
Thanks for the response!
I've just tried this one in my lab, but unfortunately it still strips off the leading 0 when I look at session.logon.last.username afterwards. When you run it with for example 012346 as a username, what does the variable look like afterwards in your system?
Thanks!
Aug 27, 2021
Hello Alex.
Apply this iRule to your VS.
when ACCESS_POLICY_AGENT_EVENT {
if { [ACCESS::policy agent_id] eq "format_username" } {
ACCESS::session data set session.logon.last.username "[ACCESS::session data get "session.logon.last.username"].0"
}
}
Then configure an iRule Event box in your APM policy with ID "format_username".
Let me know if this works in your scenario.
Regards,
Dario.
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