[collectd] backreferences in replace target
Kimo Rosenbaum
kimor79 at yahoo.com
Thu Feb 21 07:33:28 CET 2013
For this particular case using multiple Host options accomplishes what I need to do:
Host "^[a-z0-9-]+-" ""
Host "\\..*" ""
Thanks
Kimo
----- Original Message -----
> From: Kimo Rosenbaum <kimor79 at yahoo.com>
> To: collectd <collectd at verplant.org>
> Cc:
> Sent: Wednesday, February 20, 2013 4:07 PM
> Subject: [collectd] backreferences in replace target
>
>
>
> Hello,
>
> Is it possible to use backreferences in a replace target? ie:
>
>
> <Target "replace">
> Host "foo-\(bar\).baz.com" "\1"
> </Target>
>
> None of these seem to work, given a host of foo-bar.baz.com and I want
> bar.baz.com:
>
>
> Host "^[a-z0-9-]+-([a-z0-9]+)" "\1" -> 1.baz.com
>
> Host "^[a-z0-9-]+-([a-z0-9]+)" "\\1" ->
> \1.baz.com
>
> Host "^[a-z0-9-]+-\([a-z0-9]+\)" "\1" ->
> 1.baz.com
>
> Host "^[a-z0-9-]+-\\([a-z0-9]+\\)" "\1"
> -> foo-bar.baz.com
>
> Host "^[a-z0-9-]+-\\([a-z0-9]+\\)"
> "\\1" -> foo-bar.baz.com
>
>
> My end goal is to be able to have RRD files written out with the full hostname
> and data sent to write_http with just a portion of the hostname.
>
> Thanks
> Kimo
>
>
> _______________________________________________
> collectd mailing list
> collectd at verplant.org
> http://mailman.verplant.org/listinfo/collectd
>
More information about the collectd
mailing list