Query data from Grafana Loki with logql

Hello!

I cannot query data from Grafana Loki with flux.
1725026744 is the timestamp and 22743 the value in the following example. How to I get this data into influxdb? I see the request in loki, but no output with flux.

InfluxDB v2.7.10

$ curl -G -s "http://localhost:3100/loki/api/v1/query_range" --data-urlencode 'query=sum(count_over_time({service="xxx"} |= "took" [5m]))' | jq
{
  "status": "success",
  "data": {
    "resultType": "matrix",
    "result": [
      {
        "metric": {},
        "values": [
          [
            1725026744,
            "22743"
          ],
          [
            1725026758,
            "22253"
          ],
          [
            1725026772,
            "22328"
          ],
[...]

I’m using this documentation: logql package | Flux Documentation

Hello hmm I’m not sure I’ve never used the logql package

But i think youll need the start and end

import "contrib/qxip/logql"

option logql.defaultURL = "http://qryn:3100"

logql.query_range(query: "{job=\"dummy-server\"}", start: -1h, end: now(), limit: 100)

and then after that id add the count instead of took 5m and regex? can you try just returning any data first with that package and then using flux to further filter and process your data rather than with logql?

@scott might know more.

Hello
Thank you for you answer!

I’t looks like I don’t get any data from logql in flux: