LOKI/LogQL value timeseries data, raw/recent value in log line (without aggregation)

Example I have following log data:
INFO | 2021-05-17 15:27:55.2544 | blah blah… tracked_unconnected=5 tracked_total=6345 diidabadiiaba
INFO | 2021-05-17 15:37:55.2544 | blah blah… tracked_unconnected=8 tracked_total=6345 diidabadiiaba
INFO | 2021-05-17 15:57:55.2544 | blah blah… tracked_unconnected=1 tracked_total=6345 diidabadiiaba

Now, getting this into Grafana as Stats panel to show last value, without! aggregation function as timeseries data… as tracked_unconnected “1” . with eg. TimeRange last 24hours.

This the closest working solution I got working:
quantile_over_time(
0.99,
{job=“TrackedTest”}
| logfmt
| unwrap tracked_unconnected
| error=""[1m]
) by (job)

This would require is a “raw” function (no aggregation). Like I want to have [0s] timeslice. Or then unwrap would work without aggregation function. I tried last_over_time function, but for some reason that is not recognized (using LOKI 2.2.1)

How you guys have been manage to pull out these type of things to Grafana via logs? is there a better way with LOKI.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.