[collectd] Tail plugin: generating different "instances" by "regex_group"

Gerardo Herzig gherzig at fmed.uba.ar
Fri Nov 15 16:39:39 CET 2013

Hi all. Im not really shure about how to ask this, so i will jump rigth into the objective:

Im parsing a PostgreSQL log file, in order to get the average time for the running queries:

It look like this:

Barricade:/var/log/postgres # tail postgresql.log | grep duration

<(9319) guest at xx.xx.xx - base_one - 2013-11-15 12:33:30 ART (52863eca.2467)> -> (00000)LOG:  duration: 1.510 ms
<(9319) guest at xx.xx.xx: - base_two - 2013-11-15 12:33:30 ART (52863eca.2467)> -> (00000)LOG:  duration: 0.203 ms

Just as an example, there is an entry for a query executed in "base_one", and another in "base_two"

I have more than 30 databases, so using fixed strings for database "capturing" is not my first option!

I want to have a "Line" for the average query duration *in each database*

I can manage the regexp to capture it, and how to group it, but a little messy when i need to tell this in the collectd.conf

Any hints would be appreciated.



More information about the collectd mailing list