Forum Discussion

John_Stevensen's avatar
John_Stevensen
Icon for Nimbostratus rankNimbostratus
Mar 07, 2012

IRULE FAIL: PARSE syntax 59 {syntax error in expression " [active_members pool_POOL5] = 1": extra tokens at end of expression}]

Trying to create an IRULE that:

 

 

Check for existence of a string in a URI - if string exists - assign to pool_POOL5 only if pool_POOL5 is alive (active_members = 1)

 

 

 

 

 

 

 

 

Heres what I have:

 

 

 

when HTTP_REQUEST {

 

if { [active_members pool_POOL5] = 1} {

 

if { [HTTP::uri] contains "EA/Clinical/MedicineAssociatesECD.nsf" } {

 

pool pool_POOL5}

 

}

 

else {pool pool_POOL1}

 

}

 

 

 

 

Heres what I get when trying to save the IRULE:

 

 

 

01070151:3: Rule [irule_URI_redir_POOL5] error: line 2: [parse error: PARSE syntax 59 {syntax error in expression " [active_members pool_POOL5] = 1": extra tokens at end of expression}] [{ [active_members pool_POOL5] = 1}]

 

  • Hamish's avatar
    Hamish
    Icon for Cirrocumulus rankCirrocumulus
    You're missing an '=' in the numerical comparison e.g.

    
    when HTTP_REQUEST {
      if { [active_members pool_POOL5] == 1} {
        if { [HTTP::uri] contains "EA/Clinical/MedicineAssociatesECD.nsf" } {
          pool pool_POOL5
        }
      } else {
        pool pool_POOL1
      }
    }