Difference between revisions of "Target:Replace"

From collectd Wiki
Jump to: navigation, search
(Created initial page.)
 
(Description: Add wikilink to "Identifier".)
Line 1: Line 1:
 
== Description ==
 
== Description ==
  
The <em>Replace</em> target uses <em>regular expressions</em> to substitute parts of an identifier with another string. It is similar to the <code>s///</code> command known from <em>sed(1)</em> and <em>Perl</em>. This plugin is using the <em>extended POSIX</em> flavor of regular expressions, see <em>regex(7)</em>.
+
The <em>Replace</em> target uses <em>regular expressions</em> to substitute parts of an [[identifier]] with another string. It is similar to the <code>s///</code> command known from <em>sed(1)</em> and <em>Perl</em>. This plugin is using the <em>extended POSIX</em> flavor of regular expressions, see <em>regex(7)</em>.
  
 
== Synopsis ==
 
== Synopsis ==

Revision as of 16:07, 15 July 2009

Description

The Replace target uses regular expressions to substitute parts of an identifier with another string. It is similar to the s/// command known from sed(1) and Perl. This plugin is using the extended POSIX flavor of regular expressions, see regex(7).

Synopsis

Please note that backslashes need to be escaped in the configuration.

<Target "replace">
  # Replace "example.net" with "example.com"
  Host "\\<example.net\\>" "example.com"
  
  # Strip "www." from hostnames
  Host "\\<www\\." ""
</Target>

Dependencies

  • none