cancel
Showing results for 
Search instead for 
Did you mean: 
Login & Join the DevCentral Connects Group to watch the Recorded LiveStream (May 12) on Basic iControl Security - show notes included.

getting error while creating an Irule " extra tokens at end of expression"

SamBillings1
Nimbostratus
Nimbostratus

Hello Experts,

 

I wanted to test a simple irule, after creating an irule and clicking on finished button for changes to take place I'm getting an error which says " extra tokens at end of expression " . I'm very weak at scripting . can any one please help me with this

 

this is my simple I rule

 

when HTTP_REQUEST {

 if { [HTTP::header User-Agent] contains "ipad" } {

    pool pool2}

 elseif { [HTTP::header User-Agent] conatins "Andriod" } {

    pool pool3 }

 else {

    pool Pool1 }

}

 

============================================================

this is the error i get upon clicking finish button

 

01070151:3: Rule [/Common/MOBILE] error: /Common/MOBILE:4: error: [parse error: PARSE syntax 128 {syntax error in expression " [HTTP::header User-Agent] conatins "Andriod" ": extra tokens at end of expression}][{ [HTTP::header User-Agent] conatins "Andriod" }]

 

 

1 REPLY 1

@SamBillings,

 

Here try this,

 

when HTTP_REQUEST { if {[HTTP::header "User-Agent"] contains "ipad"} then { pool pool2 } elseif {[HTTP::header "User-Agent"] contains "Andriod"} then { pool pool3 } else { pool Pool1 } }