Hi,
I’m quite new to influxdb and I’m trying to get data from Postman without much of success although from influxdb I get data.
In InfluxDB the query I’m executing is:
from(bucket: "ttn_data")
|> range(start: -30d)
|> filter(fn: (r) => r["_measurement"] == "mqtt_consumer")
|> filter(fn: (r) => r["_field"] == "BME680_breath_voc_eq")
while from Postman I have the url: http://localhost::8086/api/v2/query/analyze?orgID=myorg and in headers I have:
Accept: application/json
Content-Type: application/json
Body: raw
{
"query": "from(bucket: \"ttn_data\") \n |> range(start: -30d) \n |> filter(fn: (r) => r[\"_measurement\"] == \"mqtt_consumer\") \n |> filter(fn: (r) => r[\"_field\"] == \"BME680_breath_voc_eq\")",
"type": "flux"
}
The result of the query is 200 OK:
{
"errors": []
}
In the logs of influxdb I receive:
influxdb_1 | ts=2022-04-05T22:21:31.957352Z lvl=debug msg="user find by ID" log_id=0_fwX6iW000 store=new took=0.046ms
influxdb_1 | ts=2022-04-05T22:21:31.962078Z lvl=debug msg=Request log_id=0_fwX6iW000 service=http method=POST host=localhost:8086 path=/api/v2/query/analyze query="orgID=iot" proto=HTTP/1.1 status_code=200 response_size=14 content_length=353 referrer= remote=172.21.0.1:34270 user_agent=PostmanRuntime took=4.868ms body="{\n\"query\": \"from(bucket: \\\"ttn_data\\\") \\n |> range(start: v.timeRangeStart, stop: v.timeRangeStop) \\n |> filter(fn: (r) => r[\\\"_measurement\\\"] == \\\"mqtt_consumer\\\") \\n |> filter(fn: (r) => r[\\\"_field\\\"] == \\\"BME680_breath_voc_eq\\\") \\n |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false) \\n |> yield(name: \\\"mean\\\")\",\n\"type\": \"flux\"\n}"
Am I missing something?
Thanks