Calculate avg from numbers generated from loki

Hello, I’m trying to calculate the average from these numbers:
|||27262976||
|||39845888||
|||14680064||
|||29360128||
|||23068672||
|||27262976||
|||27262976||
|||23068672||
|||27262976||
|||27262976||
|||27262976||
|||23068672||
|||27262976||
|||31457280||
|||31457280||
|||25165824||
|||27262976||
|||37748736||
|||29360128||
|||29360128||
|||20971520||
|||27262976||
|||27262976||
|||31457280||
|||27262976||
|||27262976||
|||27262976||
|||27262976||
|||31457280||
|||29360128||
|||50331648||
|||33554432||
|||27262976||
|||20971520||
|||29360128|
can someone please help me.
I’m using loki with the helm chart version: 6.28
grafana helm chart version : 8.10
this is the query :
{service=“$app”}
| json
| line_format “{{.peak_memory}}”
| pattern (?P<memory>\d+)

avg (
  avg_over_time({service="$app"} | json | unwrap peak_memory [1h])
) / 1024 / 1024
1 Like