Forum Discussion

Anoop_Dharan_20's avatar
Anoop_Dharan_20
Icon for Nimbostratus rankNimbostratus
Feb 03, 2016

While creating an irule am getting below error , created using f5 irule editor. is there any mismatch in irule event and condition ?

01070151:3: Rule [/Common/LB_rule] error: /Common/LB_rule:4: error: [parse error: extra characters after close-brace][else{ pool /Common/pool2 }]

 

when LB_SELECTED { if{ [client_addr] equals 10.10.1.31 } { pool /Common/pool1 }else{ pool /Common/pool2 } }

 

3 Replies

  • Try adding spaces between braces and words:

    when LB_SELECTED { 
        if { [TCP::client_addr] equals 10.10.1.31 } { 
            pool /Common/pool1 
        } else { 
            pool /Common/pool2 
        } 
    }
    
  • Did you by chance copy this iRule from somewhere? Very often word processors (ex. MS Word) add metacharacters that are hidden in the iRule text editor, but cause all types of problems.

     

  • Ugh. My example was wrong. 😉

    when LB_SELECTED { 
        if { [IP::client_addr] equals 10.10.1.31 } { 
            pool /Common/pool1 
        } else { 
            pool /Common/pool2 
        } 
    }