Jump to content
Welcome to our new Citrix community!

Combining multiple OR and multiple AND inside Content switching condition


Dany Demers

Recommended Posts

Hi, I would like to know how to write CS condition policies to combine multiple group of OR conditions combined with a AND between those group of condition. Priorityzing the OR first then evaluation the AND.

Is there any kind of prioritizing I can do in the evaluation of the expression?

 

I know that the AND is && and the OR is || but for the readability I didn't convert them.

 

Here's what I would like to achieve:
 

Quote


HTTP.REQ.HOSTNAME.SET_TEXT_MODE(IGNORECASE).EQ("host1.domain.com") OR HTTP.REQ.HOSTNAME.SET_TEXT_MODE(IGNORECASE).EQ("host2.domain.com")

AND 

HTTP.REQ.URL.CONTAINS(path1) OR HTTP.REQ.URL.CONTAINS(path2)

 

 

Link to comment
Share on other sites

Apparently my googling skill arent in shape today... I found my answer, it's as simple as adding extra parenthesis around the expression to allow priority in evaluation order... it's called "Compound advanced policy expressions"

 

https://docs.citrix.com/en-us/netscaler/12/appexpert/policies-and-expressions/ns-pi-config-adv-expr-start-wrapper/ns-pi-cmpnd-adv-expr-con.html

 

This is the result I ended up with:
 

(HTTP.REQ.HOSTNAME.SET_TEXT_MODE(IGNORECASE).EQ("host1.domain.com")||HTTP.REQ.HOSTNAME.SET_TEXT_MODE(IGNORECASE).EQ("host2.domain.com"))
&&
(HTTP.REQ.URL.CONTAINS(path1)||HTTP.REQ.URL.CONTAINS(path2))

 

  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...