- simple patterns
Depending on the symbol at the start of the string, the
matcher will use one of the supported formats.
|matcher||short format||long format|
* pattern: It will use the
globmatcher to find the
patternin the string.
is defined as.
When using the short syntax, you can enable the glob format by starting the string with a
*, while in the long syntax you need to define it more explicitly. The following examples are identical.
simple_patterns can be used only with the long syntax.
- Short Syntax:
'* * '
- Long Syntax:
The string matcher reports whether the given value equals to the string.
'= foo'matches only if the string is
'!= bar'matches any string that is not
String matcher means exact match of the
string. There are other string match related cases:
- string has prefix
- string has suffix
- string contains
This is achievable using the
* PREFIX*, means that it matches with any string that starts with
* *SUFFIX, means that it matches with any string that ends with
* *SUBSTRING*, means that it matches with any string that contains
The glob matcher reports whether the given value matches the wildcard pattern. It uses the standard
path. You can read more about the library in the golang documentation, where you can also practice with the library in order to learn the syntax and use it in your Netdata configuration.
The pattern syntax is:
* ?matches any string that is a single character.
'?a'matches any 2 character string that starts with any character and the second character is
'[^abc]'matches any character that is NOT a,b,c.
'[abc]'matches only a, b, c.
'*[a-d]'matches any string (
*) that ends with a character that is between
The regexp matcher reports whether the given value matches the RegExp pattern ( use regexp.Match ).
The RegExp syntax is described at https://golang.org/pkg/regexp/syntax/.
Learn more about regular expressions at RegexOne.
Simple patterns matcher
The simple patterns matcher reports whether the given value matches the simple patterns.
Simple patterns are a space separated list of words. Each word may use any number of wildcards
*. Simple patterns allow negative matches by prefixing a word with
!*bad* *matches anything, except all those that contain the word bad.
*foobar* !foo* !*bar *matches everything containing foobar, except strings that start with foo or end with bar.