oalvarez_hyperi
Contributor
Contributor

How to create Metrics out of log files?

We have an app that's essentially dumping metric data to a log file, e.g. "responseTime=100ms". Does Hyperic have a way to create a "responseTime" metric out of the log file?
I've been reading through the documentation, and I can see how to create alerts from log files, and how to track log files, but I want to pull metrics out of the log files.
I've seen the documentation for "exec", and we could use that to parse the logs, but we'd have to keep track of the last point in the file that was previously parsed. Also it doesn't appear that one can provide more than 1 set of metrics. For example, if "responseTime" appears 500 times, the agent simply reports the last one.

Sample log:

GroupId=foo responseTime=100
GroupId=foo responseTime=200
GroupId=bar responseTime=300

I'd like to create a "responseTime" metric for an entity named "foo" and another named "bar". "foo" would have 2 data pooints for responseTime of 100 and 200, whereas "bar" would only have one of "300".

Any ideas on the best way to do this?

Thanks.
0 Kudos
2 Replies
djinn_fr
Contributor
Contributor

You should be able to do that by using a script and link it with the script plugin:
http://support.hyperic.com/confluence/display/DOCSHQ30/Script+Plugin
0 Kudos
oalvarez_hyperi
Contributor
Contributor

I saw that. However, there'll be many metric values reported for the same item. For example:

responseTime=100
responseTime=200
responseTime=250

Testing this on the command line implied that the only value that would be registered would be the last value or '250'. Is there any way to have the agent collect all the values? That is, the '100', '200' and '250'?
0 Kudos