[collectd] Regex match

Thorvald Hallvardsson thorvald.hallvardsson at gmail.com
Thu Oct 20 16:57:31 CEST 2016


Hi guys,

I have a problem with one application where I want to track and graph
response times. At the moment I had to change the source to log special
line in the log which is recognised by collectd match.

I have a log which generates values in ms.

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

Generally I'm trying to catch 486 in that case.

I have a tail plugin configured for the new log entry which now looks like:
2016/10/20 14:51:05 COLLECTD TIME=486 and it works

<Plugin "tail">
  <File "/var/log/app.log">
    Instance "app_log"
    <Match>
      Regex "COLLECTD TIME=([0-9.]+)"
      DSType "GaugeAverage"
      Type "response_time"
      Instance "result"
    </Match>
  </File>
</Plugin>

I was trying to find a regex to match the proper log entry but I couldn't
work it out. I tried

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

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

Thanks.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20161020/95ae86cd/attachment.html>


More information about the collectd mailing list