URI
Note: URI format: http://host[:port\]/path/?query](http://host/path/?query)
Common Condition Primitive Parameter
- patterns: String, representing multiple patterns, format is as “pattern1|pattern2”
- case_insensitive: Bool, case insensitive
Host
req_host_in(patterns)
- Judge if host matches configured patterns
Case insensitive
// match www.bfe-networks.com or bfe-networks.com, case insensitive
req_host_in(“www.bfe-networks.com|bfe-networks.com”)
Note: the both sides of | can not be space```
right:
req_host_in(“www.bfe-networks.com|bfe-networks.com”)
wrong:
req_host_in(“www.bfe-networks.com | bfe-networks.com”)```
Path
req_path_in(patterns, case_insensitive)
- Judge if request path matches configured patterns
// if path is /abc,case insensitive
req_path_in(“/abc”, true)
- Judge if request path matches configured patterns
req_path_prefix_in(patterns, case_insensitive)
- Judge if request path prefix matches configured patterns
// if path prefix is /abc,case insensitive
req_path_prefix_in(“/x/y”, false)
- Judge if request path prefix matches configured patterns
req_path_suffix_in(patterns, case_insensitive)
- Judge if request path suffix matches configured patterns
// if path suffix is /abc,case insensitive
req_path_suffix_in(“/x/y”, false)
- Judge if request path suffix matches configured patterns
Note:The patterns of req_path_in and req_path_prefix_in need to be included “/“
Query
req_query_key_in(patterns)
- Judge if query key matches configured patterns
# if key in query is abc
req_query_key_exist(“abc”)
- Judge if query key matches configured patterns
req_query_key_prefix_in(patterns)
- Judge if query key prefix matches configured patterns
# if key prefix in query is abc
req_query_key_prefix_in(“abc”)
- Judge if query key prefix matches configured patterns
req_query_value_in(key, patterns, case_insensitive)
- Judge if value of query key matches configured patterns
# if the value of abc in query is XXX, case insensitive
req_query_value_in(“abc”, "XXX", true)
- Judge if value of query key matches configured patterns
req_query_value_prefix_in(key, patterns, case_insensitive)
- Judge if value prefix of query key matches configured patterns
# if the value prefix of abc in query is XXX, case insensitive
req_query_value_prefix_in(“abc”, "XXX", true)
- Judge if value prefix of query key matches configured patterns
req_query_value_suffix_in(key, patterns, case_insensitive)
- Judge if value suffix of query key matches configured patterns
# if the value suffix of abc in query is XXX, case insensitive
req_query_value_suffix_in(“abc”, "XXX", true)
- Judge if value suffix of query key matches configured patterns
req_query_value_hash_in(key, patterns, case_insensitive)
- Judge if the hash value of specified query matches configured patterns (value after hash is 0~9999)
# if the hash value of query abc is 100, case insensitive
req_query_value_hash_in(“abc”, "100", true)
- Judge if the hash value of specified query matches configured patterns (value after hash is 0~9999)
Port
- req_port_in(patterns)
- Judge if port matches configured patterns
# check if port is 80 or 8080
req_port_in(“80|8080”)
- Judge if port matches configured patterns
URL
- req_url_regmatch(patterns)
- patterns is regular expression to match yrl
- ` is recommended using
# check if url is "/s?word=123"
req_url_regmatch(`/s\?word=123`)