Forum Discussion
southern_shredd
Mar 17, 2022Cirrus
irule matching variable in uri
We are having trouble with an irule that matches a value in a uri and send it to a different pool. The value is the last 2 digits in the uri example: https://testinguri.dev.no:443/A2ABC/GT_10...
- Mar 17, 2022
Hello, this should do
when HTTP_REQUEST { if {[HTTP::path] starts_with "/A2ABC/" && [class match [HTTP::query]] eq query-data-group }{ pool variable_pool } }
I would suggest using a data-group for easier management and scalability on URI values, You'll need a string-type data group named "query-data-group" (to match my example) populated like this
ltm data-group internal query-data-group { records { env=02 { } env=05 { } } type string }
Regards
CA
southern_shredd
Mar 18, 2022Cirrus
Will changing the order affect the logic much? Its the only way that does not give a syntax error
when HTTP_REQUEST {
if { [class match [string tolower [HTTP::query]] equals query-data-group] && [HTTP::path] starts_with "/A2ABC/" } {
pool variable_pool }
else {
pool normal_pool
}
}
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