Forum Discussion
Kevin_Stewart
Aug 29, 2013Employee
I was showing you performance output using TCLSH from the command line and the time command. It's probably not likely that you have more than a few defined route domains, all of which you know about in advance, so a literal string map is probably most efficient:
set clientip [string map {%1 "" %2 "" %3 ""} [IP::client_addr]]
log local0. "Request from: $clientip"
If, however, you truly need something more dynamic, then a regular expression will work. Keep in mind of course that a regular expression is, in general, going to be more CPU-intensive.
set clientip [regsub {%\d+} [IP::client_addr] ""]
log local0. "Request from: $clientip