Skip to content
Florian Forster edited this page Nov 21, 2023 · 1 revision
Name: Replace target
Type: target
Status: supported
FirstVersion: 4.6
Copyright: 2008 Florian octo Forster
License: GPLv2
Manpage: collectd.conf(5)
See also: List of Targets

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
Clone this wiki locally