Forum Discussion
wlepkin_98758
Dec 29, 2011Nimbostratus
F5 does not accept iRule
Hi, I'm new at iRules, and am having trouble with what seems to be a pretty basic rule, modeled after other rules I've seen both in our BigIP configuration and in DevCentral. The rule is:
rule myapps.jeppesen.com-citrixtest {
when HTTP_REQUEST {
if { [HTTP::header User-Agent] contains "CitrixReceiver" } then {
HTTP::redirect "https://myapps/PNAgent/config.xml"
} else {
HTTP::redirect "https://myapps/Citrix/XenApp"
}
}
}
I'm running BIG-IP version 9.4.6, and when I try to enter the rule via the command line, one line at a time, it likes the first and second lines, but when I enter the 'if' clause line (3rd line) I get the following error message:
BIGpipe parsing error: 012e0021:3: The requested attribute (if {) for 'rule' is invalid.
I've tried all different combinations of spacing, placement of braces, leaving out the 'then' and 'else', using 'string tolower', but every time it chokes on the 'if' clause. The rule is very similar to a rule I've seen discussed in DevCentral, with the addition of the 'else' clause. The problem must be something simple, but I just can't see it.
Anyone have any ideas?
Thanks much.
- nitassEmployeecan you try this?
[root@ve1023:Active] config b rule myapps.jeppesen.com-citrixtest '{ > when HTTP_REQUEST { > if { [HTTP::header User-Agent] contains "CitrixReceiver" } then { > HTTP::redirect "https://myapps/PNAgent/config.xml" > } else { > HTTP::redirect "https://myapps/Citrix/XenApp" > } > } > }' [root@ve1023:Active] config b rule myapps.jeppesen.com-citrixtest list rule myapps.jeppesen.com-citrixtest { when HTTP_REQUEST { if { [HTTP::header User-Agent] contains "CitrixReceiver" } then { HTTP::redirect "https://myapps/PNAgent/config.xml" } else { HTTP::redirect "https://myapps/Citrix/XenApp" } } }
- hooleylistCirrostratusCan you try it without the "then":
when HTTP_REQUEST { if { [HTTP::header User-Agent] contains "CitrixReceiver" } { HTTP::redirect "https://myapps/PNAgent/config.xml" } else { HTTP::redirect "https://myapps/Citrix/XenApp" } }
- wlepkin_98758Nimbostratus
Wow, that worked! I assume the 'b' is an abbreviation for 'bigpipe', and thus apparently the problem was not with the rule itself, but rather just the way I was entering it.
- wlepkin_98758NimbostratusUm, sorry, am not familiar with the forum, and had assumed that my reply above would be associated with the particular answer I replied to. 'nitass's suggestion was what did the trick, and I thank him. With respect to 'hoolio's suggestion, I had already tried eliminating the 'then', which made no difference, but thanks anyway.
- hooleylistCirrostratusNo worries...
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects