PRTG Manual: Regular Expressions

For some sensors, you can use regular expressions to match a search pattern. PRTG supports Perl Compatible Regular Expression (PCRE).

The following sensors support using regular expressions:

i_round_redYou can only use regular expressions for the respective sensors if you explicitly enable using regular expressions in the sensors' settings.

i_round_redPRTG supports regular expression (regex) options in the form (?isgmxUJ) and their negations like, for example, (?-i). PRTG does not support regex flags like, for example, /g (global), /s (single line), or /gs, and does not correctly search for the target string if you try to set flags.

See below for examples with the most common patterns and an example for possible matches.

Common Search Patterns

Find matches containing the word error or alarm:

\b(error|alarm)\b

Find matches containing the word ERROR, not error, using case sensitivity:

(?-i)\bERROR\b

Find matches containing the words error and alarm, in any order:

(?=.*\berror\b)(?=.*\balarm\b).*

Find matches containing all of the words tree, flower, leaf, and bug, in any order:

(?=.*\btree\b)(?=.*\bflower\b)(?=.*\bleaf\b)(?=.*\bbug\b).*

 
i_round_redIt is not possible to match an empty string using the PRTG regex search with sensors.

Example

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!

More

i_square_blueMISCELLANEOUS

Regex101: Test and debug your regular expressions

Regex Tester: Test regular expressions interactively

Wikipedia: Regular expression

Advanced Topics