Forum Discussion
pt_73812
Nimbostratus
Jan 26, 2010dash in URI breaking pool selection?
Hello all,
I've run into a problem with an irule I'm working on. Basically, if there is a dash in the uri, the rule does not seem to pick it up correctly unless there's a trail...
hoolio
Cirrostratus
Jan 26, 2010Aye... so you're saying that the logs lines are actually this:
Jan 26 11:23:52 tmm tmm[1643]: Rule log_test : 71.x.x.x:1370: GET request to www.xyz.com/tv/my-link
Jan 26 11:23:52 tmm tmm[1643]: Rule log_test : 71.x.x.x:1370: Matched /tv, using unix_servers
Jan 26 11:23:52 tmm tmm[1643]: Rule log_test : 71.x.x.x:1371: GET request to www.xyz.com/tv
Jan 26 11:23:52 tmm tmm[1643]: Rule log_test : 71.x.x.x:1371: Matched /tv, using unix_servers
Jan 26 11:37:05 tmm tmm[1643]: Rule log_test : 71.x.x.x:1387: GET request to www.xyz.com/tv/my-link/
Jan 26 11:37:05 tmm tmm[1643]: Rule log_test : 71.x.x.x:1387: Matched /tv/my-link, using windows_servers
So a request to /tv/my-link doesn't match the same condition as a request for /tv/my-link/ when you're checking for '[HTTP::uri] starts_with "/tv/my-link"'? If so, that's quite odd. The string matching should be fairly bullet proof. I can't see how this could be happening if the anonymized strings you're posting accurately reflect the iRule you're testing.
Here is a simple test iRule which shows the matching working:
when RULE_INIT {
set my_uri "/tv"
log local0. "uri: $my_uri"
if {$my_uri starts_with "/tv/my-link"}{
log local0. "matched /tv/my-link"
} elseif {$my_uri starts_with "/tv"}{
log local0. "matched /tv"
} else {
log local0. "no match"
}
}
And log output for a few sample $my_uri values:
: uri: /tv/my-link/test123
: matched /tv/my-link
: uri: /tv/my-link
: matched /tv/my-link
: uri: /tv/
: matched /tv
: uri: /tv
: matched /tv
Aaron
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
