Display scraped values from logs

Hi, I have some log lines in Loki,

[10-Oct-2023 08:22:19 UTC] [1270628]: INFO SEND: Sending 235 emails…
[10-Oct-2023 08:23:19 UTC] [1270628]: INFO SEND: Sending 220 emails…
[10-Oct-2023 08:24:19 UTC] [1270628]: INFO SEND: Sending 442 emails…

and I’m trying to create a simple line chart. My progress is:

{filename=“/var/log/php/error_cli.log”} |~ INFO SEND: Sending \d+ | pattern <_> <_> INFO: GMAIL_SEND: Sending <cnt> <_>

and I’m stuck here. I don’t know how do display those fixed “cnt” (did I even obtain this correctly?) values on the chart, without any aggregation. Just a fluctuating line over time, showing at each point values like 235, 220, 442

Some help would be greatly appreciated :slight_smile:

moved it to the correct category

What you need to do is filter the extracted “cnt” label into the Line field of the panel

| line_format `{{.cnt}}`

and then apply a Convert field type transform on the Line field of the panel.
image
Then you should change your visualization to a Time Series and enjoy the results.

Although I am not sure if your query would work, here is how I would make it:

{filename="/var/log/php/error_cli.log"} |= `INFO SEND: Sending` | pattern `[<_>] [<_>]: INFO SEND: Sending <cnt> <_>` | cnt =~ `^\d+$` | line_format `{{.cnt}}`