Forum Discussion
Sep 24, 2008
Please help - can't understand error in this case
Very simple irule, basically I want to send to one of two pools based on some criteria.
In parsing, I get an error:
line 5: [parse error: PARSE syntax 192 {syntax error in expression " ([HTTP::host] contains "abc.xyz.com") && ([HTTP::cookie] ...": looking for close parenthesis}]
and:
line 8: [undefined procedure: else] [else {
pool test-old
the code looks like:
when HTTP_REQUEST {
if { ([HTTP::uri] contains "a.m") || ([HTTP::uri] contains "b.m")} {
pool test-new
}
elseif { ([HTTP::host] contains "abc.xyz.com") && ([HTTP::cookie] exists "cookieid")} {
pool test-new
}
else {
pool test-old
}
}
Sorry to post something so basic, but I've been staring at this for an hour and see all the parends I think are required and am totally stumped by the else error on line 8.
TIA to all!
- hoolio
Cirrostratus
Hi,when HTTP_REQUEST { if { ([HTTP::uri] contains "a.m") || ([HTTP::uri] contains "b.m")} { pool test-new } elseif { ([HTTP::host] contains "abc.xyz.com") && ([HTTP::cookie] exists "cookieid")} { pool test-new } else { pool test-old } }
- Thanks Aaron - actually the issue was very obvious once I noticed... the HTTP::cookie section shouldn't be in parends, but just in brackets around the statement reading [HTTP::cookie exists "cookiename"]
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