Hanyang Jerry
Hanyang Jerry

Reputation: 25

Flux Query on Command Prompt

I've been trying Flux query on command prompts few hours for simple query. I'm using InfluxDB 2.7 and InfluxDB-Client 2.7.3. Here is how my data look like in my bucket first

_measurement _field _value _time
airSensors co 0.1 2023-07-14T00:36:52Z
airSensors co 0.2 2023-07-14T00:37:02Z

This is my query from(bucket: "first") |> range(start: 2023-07-14T00:00:00Z, stop: now()) |> filter(fn: (r) => r["_measurement"] == "airSensors"). It runs success fully in Data Explorer but not command prompt. I got not idea why is this happening. I've attached a image with my trials, where the query is runnable in Data Explorer but not command promp. Can someone help out?enter image description here

Upvotes: 0

Views: 775

Answers (1)

Hanyang Jerry
Hanyang Jerry

Reputation: 25

Solved the problem by myself.

The query string should be enclosed with double quote ", value within the query should be escaped with backslash \ only follow by double quote ".

Upvotes: 1

Related Questions