Technical Forum
Ask questions. Discover Answers.
cancel
Showing results for 
Search instead for 
Did you mean: 

i rule syntax issue

avir_225604
Nimbostratus
Nimbostratus

HI Team,

 

I am a newbie on f5 irule..I am learning the irule thing now..One the thing i am facing issue as follows:

 

my i rule code is like this:

 

when HTTP_REQUEST { if{ [HTTP::header User-Agent]contains "iPad"} { pool pool2 } elseif{ [HTTP::header User-Agent]contains "Android"} { pool pool3 } else{ pool pool1 }

 

}

I am getting the error message like below:

 

01070151:3: Rule [/Common/acme] error: line 2: [parse error: extra characters after close-quote] [} { pool pool2 } elseif{ [HTTP::header User-Agent]contains "Android"} { pool pool3 } else{ pool pool1 } ] line 6: [parse error: extra characters after close-quote] [} { pool pool3 } else{ pool pool1 } ] line 7: [undefined procedure: pool pool3 ] [{ pool pool3 }

 

else{]

can anybody please help on this..where I am wrong on this since I have just copy paste form an existing working one..I have evaluation version of 11.3 for 90 days....the working one is lab licensed and 11.6..please help on this

 

3 REPLIES 3

IheartF5_45022
Nacreous
Nacreous

Looks fine to me - try formatting like I have....?

 

when HTTP_REQUEST { if { [HTTP::header User-Agent] contains "iPad"} { pool pool2 } elseif { [HTTP::header User-Agent] contains "Android"} { pool pool3 } else { pool pool1 } }

avir_225604
Nimbostratus
Nimbostratus

yesssssss...it took now..many thanks..wanted to know did i miss anything?

 

Just tried how you typed it originally and it failed for me too.

It's all about the formatting.