[collectd] prefix hostname filter

Schmurfy schmurfy at gmail.com
Sun Mar 28 23:37:27 CEST 2010

I found the anwser so I will add it here if anyone needs it, it just seems
like PostCache was a really bad idea, if you need to write your value with
original name with a plugin and then pass it to another one with a prefix
here is how this can be done:

<Chain "PreCache">
  <Rule "default">
   <Target "write">
      Plugin "rrdtool"
    <Target "replace">
      Host "^" "toto-"
    <Target "write">
      Plugin "network"

    Target "stop"

On 25 March 2010 12:34, Schmurfy <schmurfy at gmail.com> wrote:

> Hi,
> What i wish to do is to have one collectd server receiving data from a set
> of other servers write it on disk as rrd as is and change the hostname
> before writing the value to the network plugin to be cnsumed by yet another
> collectd.
> As a first step I first tried to change the name of the data
> written locally to test it with this:
> <Chain "PostCache">
>   <Rule "add_infra_name">
>     <Target "replace">
>       Host "^" "something-"
>     </Target>
>     <Target "write">
>       Plugin "rrdcached"
>     </Target>
>     Target "stop"
>   </Rule>
> </Chain>
> In a way it works but what happens is that the rule is matched again and
> again and i have rrd named "something-something-something-xxxxxx" and it
> goes on and on xD
> Am I taking the wrong path or is there anything missing in my rule ? I
> tried to add a match to only pick hostname without "something-" in its name
> but I did not found a way to do this since negative look ahead does not
> seems to be supported in regex and the matching cannot be inverted.
> Julien A.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.verplant.org/pipermail/collectd/attachments/20100328/8d5d5d54/attachment.htm 

More information about the collectd mailing list