Forum Discussion
____177053
Cirrus
Nov 29, 2016How to use irules to do like this
How to use irules to do like this :
We have an ip like:123.12.3.5
How to get the string like:123.12.3
Thanks a lot!
VernonWells
Employee
Nov 29, 2016Let us say that you are operating on the client IP:
set reduced [string range $ip 0 [expr { [string last . [IP::client_addr]] - 1 }]]
This is ~20% faster than a variant:
set reduced [join [lrange [split [IP::client_addr] .] 0 2] .]
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