Forum Discussion
Jun 03, 2013
iRule optimization
My iRule needs to exact-match on host and wild-card match on path.
when HTTP_REQUEST {
switch [string tolower [HTTP::host]] {
"internal.mycompany.com" {
...
nitass
Employee
Jun 03, 20132nd
[root@ve10:Active] config b rule myrule list
rule myrule {
timing on
when HTTP_REQUEST {
set host [string tolower [HTTP::host]]
set path [string tolower [HTTP::path]]
set host-uri "$host/$path"
switch -glob $host-uri {
"internal.mycompany.com/api1/*" { }
"internal.mycompany.com/api2/*" { }
"internal.mycompany.com/api3/*" { }
}
}
}
ab -n 1000 http://internal.mycompany.com/api3/something
[root@ve10:Active] config b rule myrule show all
RULE myrule
+-> HTTP_REQUEST 1000 total 0 fail 0 abort
| Cycles (min, avg, max) = (34883, 69650, 510200)
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