Forum Discussion
Can't save an iRule because of formatting issues.
Hi,
I am having trouble formatting this irule:
when CLIENT_ACCEPTED { if { [class match [IP::remote_addr] equals O365_Microsoft_Networks_dg] } { if {([HTTP::uri] contains “/ews”)} { pool O365_POC_Exchange_owa_pool7 } }
Can someone help as soon as possible please ?
5 Replies
- Kareem
Nimbostratus
01070151:3: Rule [/Common/O365_Microsoft_Networks_dg_irule] error: /Common/O365_Microsoft_Networks_dg_irule:1: error: [parse error: missing close-brace][{ if { [class match [IP::remote_addr] equals O365_Microsoft_Networks_dg] } { if {([HTTP::uri] contains &8220;/ews&8221;)} { pool O365_POC_Exchange_owa_pool7 } }] /Common/O365_Microsoft_Networks_dg_irule:2: error: [command is not valid in the current scope][if { [class match [IP::remote_addr] equals O365_Microsoft_Networks_dg] } { if {([HTTP::uri] contains &8220;/ews&8221;)} { pool O365_POC_Exchange_owa_pool7 } }] - nitass
Employee
you cannot use HTTP:: command in CLIENT_ACCEPTED. change to HTTP_REQUEST event and it looks okay here.
root@(ve11a)(cfg-sync In Sync)(Active)(/Common)(tmos) list ltm rule qux ltm rule qux { when HTTP_REQUEST { if { [class match [IP::remote_addr] equals O365_Microsoft_Networks_dg] } { if { ([HTTP::uri] contains "/ews")} { pool O365_POC_Exchange_owa_pool7 } } } } - Kareem
Nimbostratus
Thanks, that works. What if I want two conditions to be met before the pool is chosen, what should the irule look like ? Below is the current irule: I mean make it only one if statement:
when HTTP_REQUEST { if {[class match [IP::remote_addr] equals O365_Microsoft_Networks_dg]} {
if {[HTTP::path] equals "/ews" } { pool O365_POC_Exchange_owa_pool7 } } } - nitass
Employee
What if I want two conditions to be met before the pool is chosen, what should the irule look like ?
you can use operator such as and, or.
if { condition1 and condition2 } { action } - nitass
Employee
can you try this?
when HTTP_REQUEST { if { [class match [IP::remote_addr] equals O365_Microsoft_Networks_dg] and [HTTP::path] equals "/ews" } { pool O365_POC_Exchange_owa_pool7 } }
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