apache kafka – Is there a way to convert this InfluxQL to Flux for data imported via telegraf?

I am using InfluxDB V2 (cloud) and have the following script to gather data from the source (kafka_consumer as an input to telegraf):

FROM "kafka_consumer"
time >= now() - interval '7 days'

I was wondering how to convert this to Flux so that I can see results on Grafana

I tried going through the Flux documentation and came up with:

from(bucket: "test")
  |> range(start: -30d)
  |> filter(fn: (r) => r._measurement == "kafka_consumer", r._value == "value")

This produces no results

Read more here: Source link