PRTG Manual: Regular Expressions
For some sensors, you can use regular expressions (regex) to match a search pattern. PRTG supports Perl Compatible Regular Expression (PCRE).
The following sensors support regex:
You can only use regex for the respective sensors if you explicitly enable regex in the sensors' settings.
PRTG supports regex options in the form (?isgmxUJ) and their negations, for example, (?-i). PRTG does not support regex flags like /g (global), /s (single line), or /gs, and does not correctly search for the target string if you try to set flags.
Find matches that contain the word error or alarm:
\b(error|alarm)\b
Find matches that contain the word ERROR, not error, using case sensitivity:
(?-i)\bERROR\b
Find matches that contain the words error and alarm, in any order:
(?=.*\berror\b)(?=.*\balarm\b).*
Find matches that contain all of the words tree, flower, leaf, and bug, in any order:
(?=.*\btree\b)(?=.*\bflower\b)(?=.*\bleaf\b)(?=.*\bbug\b).*
It is not possible to match an empty string with the regex search with sensors.
The search pattern
(?i)(?=.*\berror\b)(?=.*\balarm\b).*
matches the following expressions:
- Alarm error
- Error alarm
- I am an error and I trigger an alarm.
- I am an alarm and I indicate an error.
- An alarm combined with an error indeed!
- An error combined with an alarm, too!