[collectd] Generalized ignorelist functionality

Luboš Staněk lubek at users.sourceforge.net
Fri Nov 24 12:29:36 CET 2006


Hi Florian,

Florian Forster napsal(a):
> Hi Lubos,
> 
> On Wed, Nov 22, 2006 at 03:54:09PM +0100, Lubo?? Stan??k wrote:
>> To summarize:
>> - "string" - means full match string -> will be converted to ^string$
> 
> Yes, but `"string.with.dots"' needs to be converted to
> `^string\.with\.dots$' to match literal dots. Likewise for other special
> characters. I'm still undecided if this really is a good idea, or if the
> little code necessary to use `strcmp' in those cases isn't simpler.
> 
>> - any other string:
>>   - string - means partial match -> no conversion, append as regex
> 
> Right.
> 
>>   - ^string$ - means full match regex -> no conversion, append as regex
> 
> Yes, but this is the same case, no special treatment necessary.
> 
>> The user is responsible for providing prefixed characters (if any)
>> inside any variant.
> 
> With strings I don't know. _Why_ would you escape a dot in a string?
> Also, what about `"String with \"quote\""'? As it is, we simply strip
> the leading and trailing quote, so the backslashes are matched
> literally. IMHO that's unintuitive, too..
> 
> Another though has crossed my mind: Why not require both, either
>   "some string"
> or
>   /(some )?regex/
> with any other leading character `[^"/]' throwing an error? I really am
> undecided here ;)
> 

This all looks very difficult to solve and program it flawlessly.
There is another problem. My regex implementation is for 8-bit
characters. It will work with the UTF-8 strings till you want to check
special character properties. The glibc POSIX regular expression
implementation does not have these features. I met it only in PCRE >=
5.0. You can object to this that it will be rare. With a HAL mounted
media it is possible, take into account that UDF DVD has Unicode volume
label.

The current version is satisfactory. The users simply continue using
'string' identification and use '/regex/' when they need it. The regex
entry is intuitive enough due to the '//' delimiters as it is used by
many other tools.
Release a new version with the current implementation and we will see
the feedback. I do not want to stand for other users in our two man show. :)


>> The last problem is that the user does not have any tool to check or
>> test his own expressions.
>> The log contains only error messages in cases where the regex cannot
>> be compiled.
> 
> That's right to a point - you can always use `echo' and `egrep' to test
> your expressions ;) Anyway, what do you suggest?
> 

I have thought about parameter checking tool that would load config file
and plugins the same way the daemon would do and run one step without
calling plugins' write(). The one step would report all on 'stderr'. All
means every collectable entry, result of ignorelist match, all errors
and so on.


Best regards,
Lubos



More information about the collectd mailing list