Skip to content

Match: regex

Plugin name match_regex
Status supported
Since 4.6
Copyright 2008 Sebastian Harl, 2008 Florian octo Forster
License GPLv2
Configuration collectd.conf(5)

Description

The RegEx match uses regular expressions to match values using their identifier. The identifier consists of the five parts that are used to identify each value-list: Host, plugin, plugin instance, type, and type instance. You can configure one regular expression for each part – the RegEx match matches if all regular expressions match.

Synopsis

 LoadPlugin "match_regex"
 <Chain "PreCache">
   <Rule "ignore_non_fqdn">
     <Match "regex">
       Host "^[^\\.]*$"
       Invert false
     </Match>
     Target "stop"
   </Rule>
 </Chain>

The above example matches all values, where the host field does not contain at least one dot, and ignore them. This can be useful on server instances to filter out values from hosts that do not report their name as fully qualified domain name (FQDN).

Dependencies

  • none

History

The RegEx match has been available since Version-4.6.

Configuration

Configuration options · from collectd.conf(5)

See this section in the full configuration reference

Matches a value using regular expressions.

Available options:

Host Regex
Plugin Regex
PluginInstance Regex
Type Regex
TypeInstance Regex
MetaData String Regex
Match values where the given regular expressions match the various fields of the identifier of a value. If multiple regular expressions are given, all regexen must match for a value to match.
Invert false|true
When set to true, the result of the match is inverted, i.e. all value lists where all regular expressions apply are not matched, all other value lists are matched. Defaults to false.

Example:

<Match "regex">
  Host "customer[0-9]+"
  Plugin "^foobar$"
</Match>