[collectd] Question about curl plugin and regexps
Amos Shapira
amos.shapira at gmail.com
Thu Feb 17 07:19:54 CET 2011
On 17 February 2011 12:33, Martin B. Smith <smithmb at ufl.edu> wrote:
> On 2/16/2011 3:50 AM, Amos Shapira wrote:
> > When I saw regexp used in collectd configuration file (using the tail
> > plugin) it was double quoted, ie \\ for \.
>
> Hi Amos,
>
> Thank you for the tip. That made it so my regexp did start matching. I
> couldn't tell if the vertical pipe needed the double-escape or not.
>
> Could you also explain why only my first <Match> actually gets results
> given the output:
>
> > active_users_count|3|3|
> > active_users_5mins|0|0|
> > active_users_30mins|1|1|
> > active_users_60mins|1|1|
>
> My matches look like:
>
> <Match>
> Regex "active_users_count\\|([0-9]+)"
> DSType "GaugeLast"
> Type "my_users"
> Instance "active_users_count"
> </Match>
> <Match>
> Regex "active_users_5mins\\|([0-9]+)"
> DSType "CounterSet"
> Type "my_users"
> Instance "active_users_5mins"
> </Match>
> <Match>
> Regex "active_users_30mins\\|([0-9]+)"
> DSType "CounterSet"
> Type "my_users"
> Instance "active_users_30mins"
> </Match>
>
> It seems weird that only the first match now returns data. Does only one
> match apply per Page URL?
>
Sorry I can't answer that, I'm not familiar with this plugin.
Have you though of trying to use a separator which is not a special regexp
character, thus avoiding the issue with "|"?
--Amos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20110217/477b7832/attachment.htm>
More information about the collectd
mailing list