[collectd] Unify the filter_pcre and filter_ignore plugins
octo at verplant.org
Tue Oct 28 23:12:50 CET 2008
for those who haven't noticed yet: Sebastian and I have introduced a new
type of plugin, called ``filter plugin''. It is called before the
`write' plugins and can be used to alter the values (or their name) or
to ignore some values altogether.
> filter_pcre: Added a plugin to filter value lists based on PCRE.
> The user may specify a set of Perl-compatible regular expressions to match any
> component of the (host, plugin, plugin instance, type, type instance) tuple.
> Any of the filter flags may be used to handle a successful match.
> Sample plugin configuration:
> <Plugin filter_pcre>
> Host "^mail\d+$"
> Plugin "^tcpconns$"
> TypeInstance "^SYN_"
> Action NoWrite
I'm thinking about unifying the this plugin and the new `filter_ignore'
plugin are configured. The `filter_ignore' provides only three options:
The `filter_ignore' doesn't use any (`RegEx'-)blocks. Only one `ignore'
rule has to match for a value to be ignored. Thus, the only way to
ignore a specific `type, type-instance' pair (likewise for `plugin') is
to specify them at once. For example:
This rule will ignore all errors of non-`ppp' interfaces, because
interface errors are often only interesting on WAN interfaces. Traffic
(i. e. `if_octets') as still collected for all interfaces. The extra
slashes mark a regular expression, since the usual `ignorelist'
functionality is used.
I think adding these blocks to `filter_ignore' is a must, if only to
make the selection possibilities functional complete. (scnr ;)
I'm at a loss if the `TypeInstance' and `PluginInstance' options should
be merged into the `Type' and `Plugin' options in the `filter_pcre'
plugin. Thoughts, anyone?
Also, would it be possible to fall back to ``normal'', i. e. enhanced
POSIX regular expressions if `libpcre' isn't available? Then we could
completely ditch the `filter_ignore' plugin, imho. Sebastian, what do
Florian octo Forster
Hacker in training
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://mailman.verplant.org/pipermail/collectd/attachments/20081028/be399dc7/attachment.pgp
More information about the collectd