Match expressions are read from left to right. Expressions contained within parentheses get
evaluated before other parts of the expression. The previous expression would match anything
that was not happy or that was round and happy.
Unlike the previous example, match functions correspond to certain attributes in a request
header.
For example, a request URI for a web page might look like this:
\Get /somedir/somepage.html http/1.1
Accept: text/html, text/*, *.*
Accept-Encoding: gzip
Host: www.website.com
User-Agent: Mozilla/4.7 [en] (Win98; U)
Various functions return true when their arguments match certain components of the request URI.
Using the above request URI, for example, you could use several match functions:
l
pathname()
return
s true if its argument matches
/somedir/somepage.html
l
dirname()
retu
rns true if its argument matches
/somedir/
l
filename()
retu
rns true if its argument matches
somepage.html
Other functions can evaluate the contents of the
Host
header in the request URI above:
host (www.website.com)
host_prefix (www)
host_suffix (website.com).
Some function arguments can take the form of a regular expression
1
. Note that you cannot put
regular expressions.
Matching regular expressions (using *_regex() functions) is many times more
processing-intensive than using other match functions. It is usually possible to
avoid using regular expressions by carefully crafting match expressions using
other functions. For example, the following regular expression match:
dirname_regex("(two|four|six|eight)")
Can be replaced by the more efficient:
dirname_substr("two") ||
dirname_substr("four") ||
dirname_substr("six") ||
dirname_substr("eight")
Match Bodies
1
Regular expressions are specified according to IEEE Std 1003.2 (“POSIX.2”).
Copyright © 2014 Coyote Point Systems, A Subsidiary of Fortinet, Inc.
All Rights Reserved.
391
Equalizer Administration Guide
Summary of Contents for Equalizer GX Series
Page 18: ......
Page 32: ...Overview 32 Copyright 2014 Coyote Point Systems A Subsidiary of Fortinet Inc ...
Page 42: ......
Page 52: ......
Page 64: ......
Page 72: ......
Page 76: ......
Page 228: ......
Page 238: ......
Page 476: ......
Page 492: ......
Page 530: ......
Page 614: ......
Page 626: ......
Page 638: ......
Page 678: ......
Page 732: ...Using SNMP Traps 732 Copyright 2014 Coyote Point Systems A Subsidiary of Fortinet Inc ...
Page 754: ......
Page 790: ......
Page 804: ......
Page 842: ......
Page 866: ......