Regular expressions supported by KSS NG
When adding a Kiwi Syslog Server NG filter based on IP address, host name, or message text, use the following regular expression characters and sequences to specify the filter values.
Character | Description |
---|---|
^
|
Looks only at specified characters at the beginning of a string. Example: |
$
|
Looks only at specified characters at the end of a string. Example: |
.
|
Matches any character, except line breaks. Example: |
?
|
Matches when the previous character is repeated zero or one time. Example: |
*
|
Matches when the previous character is repeated zero or more times. Example: |
+
|
Matches when the previous character is repeated one or more times. Example: |
\
|
Escapes the next character. When the next character in the syntax is a special character, use this to indicate that the character should be interpreted literally. Example: |
|
|
Separates alternative word or letters. Example: |
{n}
|
Matches the preceding character exactly n times, where n is a non-negative integer. Example: |
{n,}
|
Matches the preceding character at least n times. Example: |
{n,m}
|
Matches the preceding character at least n times but not more than m times. Example: |
[]
|
Matches any character enclosed within the brackets. Example: |
[^ ]
|
Matches any character not enclosed within the brackets. Example: |
[a-z]
|
Matches any character in the specified range. Example: |
[^a-z]
|
Matches any character not in the specified range. Example: |
\b
|
Matches a word boundary, that is, the position between a word and a space. Example:
|
\B
|
Matches a non-word boundary. Example: |
\0-9
|
Matches a digit character. Equivalent to [0-9] . |
\0-9
|
Matches a non-digit character. Equivalent to [^0-9] . |
\f
|
Matches a form-feed character. |
\n
|
Matches a newline character. |
\q
|
Matches a quote character or ASCII value of 34. Example: |
\r
|
Matches a carriage return character. |
\s
|
Matches any white space including space, tab, form-feed, etc. Equivalent to
[ \f\n\r\t\v] . |
\S
|
Matches any nonwhite space character. Equivalent to [^ \f\n\r\t\v] . |
\t
|
Matches a tab character. |
\v
|
Matches a vertical tab character. |
\w
|
Matches any word character including underscore. Equivalent to [A-Za-z0-9_] . |
\W
|
Matches any non-word character. Equivalent to [^A-Za-z0-9_] . |
(x)\n
|
Matches consecutive identical characters or strings, where x is the character or string and n is the number of times it is repeated, not including the first occurrence. Example: |
\n
|
Matches n, where n is an octal escape value. Octal escape values must be 1, 2, or 3
digits long. For example, |
\xn
|
Matches n, where n is a hexadecimal escape value. Hexadecimal escape values must be
exactly two digits long. For example, Example: |