Forum Discussion
skunk69_85565
Nov 06, 2007Historic F5 Account
need to insert new info into HTTP query or uri
Hi everyone,
I need some advice here, please.
I am currently developing an iRule which will in the end send user requests to different pools based on IP addr, user agents, an exist...
hoolio
Cirrostratus
Nov 06, 2007You're setting qstring to the value of [HTTP::query] in an else block, but I would guess that block isn't always being hit. So you get an error when trying to reference $qstring when it hasn't been set. You could either set it to some default value or check that it has been set before trying to use it. Here's an example of the latter using 'info exists' (Click here😞
if { [info exists qstring] && $qstring starts_with "/A"} {
[edit: you might also want to handle the default condition if the qstring isn't set or is set, but doesn't start with /A or /B.]
...
if { [info exists qstring] && $qstring starts_with "/A"} {
pool poolA
} elseif { [info exists qstring] && $qstring starts_with "/B"} {
pool poolB
} else {
pool default_pool
}
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