Forum Discussion
i rule syntax issue
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
- IheartF5_45022
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
yesssssss...it took now..many thanks..wanted to know did i miss anything?
- robert-orange
Nimbostratus
Just tried how you typed it originally and it failed for me too.
It's all about the formatting.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* 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
