[collectd] Regex match

Pavel V. pavel2000 at ngs.ru
Thu Oct 20 17:28:31 CEST 2016


Hi, Thorvald.


> 2016/10/20 14:51:05 HEX a test result found (486 ms) on HOST

Try

Regex "found \(([0-9]+) ms\)"


Also you might be interested in https://github.com/collectd/collectd/pull/1700

https://regex101.com/ also might help you.


> Regex "found \(([0-9]+ ms)\)" but that didn't work. I tried

You should move "ms" out from match. Otherwise value is "486 ms" instead of
expected "486".

> Regex "found \(([0-9]+.)" but that also didn't work.

This regex does match extra symbol after digits. Matched value is "486 ". Maybe
this extra space causes problems.

> Any ideas if there is a way to extrac that number from between the bracket so collectd can write it ?

> Thanks.



-- 
Regards,
 Pavel                          mailto:pavel2000 at ngs.ru




More information about the collectd mailing list