Difference between revisions of "Match:RegEx"

From collectd Wiki
Jump to: navigation, search
(Created initial page.)
 
(Description: Add wikilink to "Identifier".)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
The <em>RegEx</em> match uses <em>regular expressions</em> to match values using their <em>identifier</em>. The <em>identifier</em> consists of the five parts that are used to identify each <em>data set</em>: Host, plugin, plugin instance, type, and type instance. You can configure one <em>regular expression</em> for each part – the <em>RegEx</em> match matches if all <em>regular expressions</em> match.
+
The <em>RegEx</em> match uses <em>regular expressions</em> to match values using their [[identifier]]. The <em>identifier</em> consists of the five parts that are used to identify each <em>data set</em>: Host, plugin, plugin instance, type, and type instance. You can configure one <em>regular expression</em> for each part – the <em>RegEx</em> match matches if all <em>regular expressions</em> match.
  
 
== Synopsis ==
 
== Synopsis ==

Revision as of 16:08, 15 July 2009

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 data set: 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

<Chain "PreCache">
  <Rule "ignore_non_fqdn">
    <Match "regex">
      Host "^[^\\.]*$"
    </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.0.