Forum Discussion
Aurel
Cirrus
Aug 28, 2013Remove characters from logging Irule entry
Hello,
I would like to remove the routing domain suffix "%1" in the log file i'm creating.
Here's a sample of my Irule.
when HTTP_REQUEST {
set client_ip [IP::remote_addr]
set log_m...
Kevin_Stewart
Employee
Aug 28, 2013There are actually many ways to do this, some static (like string map), and some dynamic (like regsub),
% time { regsub {%\d+} $ip "" } 1000
1.996 microseconds per iteration
% time { string map {%1 ""} $ip } 1000
0.661 microseconds per iteration
But then you have to be careful that the function you use doesn't negate the performance benefits of not modifying it at all.
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