Forum Discussion
Redirect based on URI
I try to implement a simple iRule.
Based on URI, traffic has to be redirected to different pools.
when HTTP_REQUEST {
if {[matchclass [HTTP::uri] starts_with "/ws/"]}{
log local0. "1. Client [IP::client_addr]: client requested [HTTP::host][HTTP::uri]"
pool pool_A
}
else {
log local0. "2. Client [IP::client_addr]: client requested [HTTP::host][HTTP::uri]"
pool pool_B
}
}
But I get the error:
- Invalid matchclass operands - no class or list type found, lhs: string, rhs: /ws/ (line 1) invoked from within "matchclass [HTTP::uri] starts_with "/ws/""
Any suggestions?
Tom
- Tom_Lauwereins_NimbostratusI have found the solution already
- Colin_Walker_12Historic F5 AccountThe matchclass command is designed to work with data groups rather than directly with strings like "/ws/". For more about the matchclass command you can look here : Click Here.
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