Telegraf LogParser plugin only parsing the last line in the log file

Finally, we were successfully able to get the logparser working with the prometheus client.

We made sure that there is atleast one numeric and the metric is being shown at /metrics endpoint. But we have the below 2 problems.

  1. The log file that we are parsing contains hundreds of line and each line has the metric we want. We are expecting that the metric in each line will be exposed to /metrics but looks like not the case. Its only exposing the metric in the last line of the file. How to fix this?

  2. The metric that we are exposing is coming as type Untyped and how can we send them as Histogram metric. In our situation as i said above, each line has the responsetime and we want the responsetimes of all calls made and want to build histogram dashboards using Grafana.

Any help is greatly appreciated. Thanks.

@daniel

@konabharat hey i am facing the same issue, did you fix it if yes what configurations are you using…