Forum Discussion
iRule equals not matching similar keys in datagroup
Hi!
So we have an iRule which matches the URI against a datagroup via equals, nothing out of the ordinary:
when HTTP_REQUEST {
set matchedEquals [class match -value [string tolower [HTTP::uri]] equals dg_list]
if {$matchedEquals ne ""} {
HTTP::respond 301 Location "$matchedEquals"
unset matchedEquals
}
}
We recently had a case where there are 2 similar URI's in the datagroup:
- /api :=
- /api/demo :=
We find that the iRule is able to match /api, but is unable to match for /api/demo. From what I understand, the equals operator would match the longest key, so not exactly sure why it is failing to match.
Any help would be much appreciated. Thanks in advance!
- youssef1
Cumulonimbus
Hi Nicholas,
strange behaviour can you replace equals by "=="
and log URI:
log local0. "URI: [string tolower [HTTP::uri]]" to be sure that you math "/api/demo"
regards
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