Forum Discussion
Irule trimleft command issue
When i use the Trim Left command in the irule, the intended part and one character from the end of the string is getting trimmed.
Below is the configured irule:
} elseif { $calledid contains "ABCNET" } then { if { $username contains "host/" } then { log local0. "Fixing username" set newusername [string trimleft $username host/] RADIUS::avp replace User-Name [binary format a* $newusername] binary scan [RADIUS::avp User-Name ] a* newusername log local0. "Fixed username $newusername" } log local0. "Detected ABCNET" set vlanid "00000009" }
Let me know if any corrections.
- Rico
Cirrus
Could you show the outputs of the command?
- JG
Cumulonimbus
Perhaps you are better off using the following:
set newusername [ findstr $username "/" 1 ]
?
- Stanislas_Piro2
Cumulonimbus
If you want to remove host at the beginning, you can do:
set newusername [string range $username 4 end]
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