Hyperscan matcher (proto)
This extension has the qualified name envoy.matching.input_matchers.hyperscan
Note
This extension is only available in contrib images.
Note
This extension is functional but has not had substantial production burn time, use only with this caveat.
This extension is not hardened and should only be used in deployments where both the downstream and upstream are trusted.
Tip
This extension extends and can be used with the following extension category:
extensions.matching.input_matchers.hyperscan.v3alpha.Hyperscan
[extensions.matching.input_matchers.hyperscan.v3alpha.Hyperscan proto]
Hyperscan regex matcher. The engine of the matcher uses hybrid automata techniques to allow simultaneous matching of large numbers of regular expressions across streams of data.
The matcher follows PCRE pattern syntax, and the regex string must adhere to the documented pattern support. The syntax is not compatible with the default RE2 regex matcher. Depending on configured expressions, swapping regex matcher may cause match rules to no longer be valid.
{
"regexes": []
}
- regexes
(repeated extensions.matching.input_matchers.hyperscan.v3alpha.Hyperscan.Regex, REQUIRED) Specifies a set of regex expressions that the input should match on.
extensions.matching.input_matchers.hyperscan.v3alpha.Hyperscan.Regex
[extensions.matching.input_matchers.hyperscan.v3alpha.Hyperscan.Regex proto]
{
"regex": ...,
"id": ...,
"caseless": ...,
"dot_all": ...,
"multiline": ...,
"allow_empty": ...,
"utf8": ...,
"ucp": ...,
"combination": ...,
"quiet": ...
}
- regex
(string, REQUIRED) The regex expression.
The expression must represent only the pattern to be matched, with no delimiters or flags.
- id
(uint32) The ID of the regex expression.
This option is designed to be used on the sub-expressions in logical combinations.
- caseless
(bool) Matching will be performed case-insensitively.
The expression may still use PCRE tokens (notably
(?i)
and(?-i)
) to switch case-insensitive matching on and off.
- dot_all
(bool) Matching a
.
will not exclude newlines.
- multiline
(bool)
^
and$
anchors match any newlines in data.
- allow_empty
(bool) Allow expressions which can match against an empty string.
This option instructs the compiler to allow expressions that can match against empty buffers, such as
.?
,.*
,(a|)
. Since Hyperscan can return every possible match for an expression, such expressions generally execute very slowly.
- utf8
(bool) Treat the pattern as a sequence of UTF-8 characters.
- ucp
(bool) Use Unicode properties for character classes.
This option instructs Hyperscan to use Unicode properties, rather than the default ASCII interpretations, for character mnemonics like
\w
and\s
as well as the POSIX character classes. It is only meaningful in conjunction withutf8
.
- combination
(bool) Logical combination.
This option instructs Hyperscan to parse this expression as logical combination syntax. Logical constraints consist of operands, operators and parentheses. The operands are expression indices, and operators can be
!
,&
or|
.
- quiet
(bool) Don’t do any match reporting.
This option instructs Hyperscan to ignore match reporting for this expression. It is designed to be used on the sub-expressions in logical combinations.