Forum Discussion
5 Replies
Sort By
- KareemNimbostratus01070151: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 } }]
- nitassEmployee
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 } } } }
- KareemNimbostratus
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]} {
- nitassEmployee
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 }
- nitassEmployee
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 } }