Forum Discussion
iRule not hitting default pool?
it could be because you are searching on http::path, but im not 100% about this. But i have made a suggestion, that takes a slightly different approach:
when HTTP_REQUEST {
if { [string tolower [HTTP::uri]] starts_with "diagnostics"} {
pool pool_group2
persist source_adr 255.255.255.255 1800
}
else { pool pool_group1
}
}
- Kai_WilkeMar 09, 2017
MVP
Hai Kai, 😉
or[HTTP::uri]
are in this specific scenario almost interchangeable. And adding a[HTTP::path]
command is always a good idea if endusers are involved... 😉[string tolower]Cheers, Kai
- Kai_M__48813Mar 09, 2017
Cirrus
yeah..was a bit unsure about that...so i just used http::uri out of old habit, and probably a lack of coffee:D
string tolower should almost be mandatory, if you ask me..has saved me countless hours of troubleshooting, because of end users using capital letters when typing in the url..
- phipseMar 09, 2017
Altostratus
Something seems to be wrong with the syntax?
Please see error below
/CCRegressionTEST/irule_CCdiagnosticsimages_redirect:4: error: ["invalid argument source_adr; expected syntax spec: (add|carp|cookie|delete|dest_addr|hash|lookup|msrdp|none|simple|sip|source_addr|ssl|sticky|uie|universal) "][persist source_adr 255.255.255.255 1800 ]
- Kai_WilkeMar 09, 2017
MVP
Hi Phipse,
just a minor typo. Change persist
topersist source_adr
...persist source_addrCheers, Kai
- phipseMar 09, 2017
Altostratus
when HTTP_REQUEST { if { [string tolower [HTTP::uri]] starts_with "diagnostics"} { pool pool_group2 persist source_addr 255.255.255.255 1800 } else { pool pool_group1 }}
Accepts this fine, however this has not resolved the issue and it breaks both the pool selections... Anything else you can suggest?
- Kai_WilkeMar 09, 2017
MVP
Hi Phipse,
the problem with the above iRule is, that an URI always starts_with a
char, so the/
condition is never meet.starts_with "diagnostics"Note: Scroll to the buttom of this page and apply the provided iRules to see where it breaks.
Cheers, Kai
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