Questions tagged [influxql]

Use this tag for questions related to InfluxQL, an SQL-like query language for interacting with data in InfluxDB.

219 questions
1
vote
1 answer

Deleting every point older than the most recent one of each unique ID

What I'm trying to achieve is to only keep the latest of any given point identified by an ID, delete everything else. The ID is a tag. So let's say we have: time ID ... 2022-06-28 18:29:00 id1 ... 2022-06-28 18:28:00 id1 …
1
vote
2 answers

Calculating average of elapsed time

I want to calculate the average time duration of my events. After an event starts and ends, it sends a request to my InfluxDB in the Line Protocol Syntax: mes1 id=1,event="start" 1655885442 mes1 id=1,event="end" 1655885519 mes1 id=2,event="start"…
1
vote
2 answers

What is the query to select multiple columns and group by one of the column in InfluxDb using Flux?

How to write similar query using Flux: SELECT field_a,field_b from 'measurement' where field_a = 10 and group by field_b
1
vote
0 answers

InfluxDB -- Err: mixing aggregate and non-aggregate queries is not supported

I’m trying to subtract the mean from a column in InfluxQL 1.7. > select col - mean(col) from sensor -- Err: mixing aggregate and non-aggregate queries is not supported > select col - 2 from sensor -- works fine > select col - meanC from (select…
AbdelKh
  • 499
  • 7
  • 19
1
vote
1 answer

How to obtain time interval value reports from InfluxDB

Using InfluxDB: Is there any way to build a time-bucketed report of a field value representing a state that persists over time? Ideally in InfluxQL query language More specifically as an example: Say a measurement contains points that report changes…
herchu
  • 936
  • 7
  • 24
1
vote
1 answer

How can I use data from more than one measurement in a single Grafana panel?

I am attempting to create a gauge panel in Grafana (Version 6.6.2 - presume that upgrading is a last resort, but possible if necessary, for the purposes of this problem) that can represent the percentage of total available memory used by the Java…
Flats
  • 81
  • 1
  • 13
1
vote
0 answers

Why is fill(0) creating entries and breaking the group?

On a project where we use influx 1.7 we have a query that behaves strangely. Basically what we're trying to do is average the data to align the time periods take the max out of these time periods sum these max values Here is an example that…
7hibault
  • 2,371
  • 3
  • 23
  • 33
1
vote
2 answers

InfluxDB: Combine data and validation series of same measurement

In my InfluxDB (V 1.8) I have one measurement with one field ("value") and one tag ("id") and a lot of series. There are two kinds of series in this measurement, one type contains raw data (float values) the other one contains validation data (float…
mgerbracht
  • 87
  • 7
1
vote
0 answers

Translating PromQL 'sum(rate(value))' queries to InfluxQL

I'm creating a custom k8s grafana dashboard with datasource as InfluxDB (v1.8.6).I have gone through the influxdb documentation and recognised that the analogical construct for prometheus rate() in influx is non_negative_derivative(mean(value),…
achilles
  • 536
  • 5
  • 16
1
vote
1 answer

Why does InfluxDB return a List of Results on Query

Im using InfluxDB v1.8.6 with the java client. And I use the following code to make queries to the database: public List query(String aQuery){ Query queryObject = new Query(aQuery,this.dbName); QueryResult queryResult =…
Lermacto
  • 11
  • 1
1
vote
2 answers

influxDB: How to convert field to tag in influxDB v2.0

We need to convert field to tag in influxDB v2.0 but not able to find any proper solution. Can someone help me out to achieve the same ? Solution we found was to create new measurement by altering fields and tags of existing measurement but not able…
1
vote
1 answer

How to query all measurements in InfluxDB where a value from one measurement equals X

I query all measurements from Influx database like so: http://localhost:8086/query?pretty=true&db=boatdata&q=SELECT value FROM /.*/ LIMIT 1 Works fine. However, instead of LIMIT 1 I need to get values for all the measurements where value from one…
Sam Zadworny
  • 23
  • 3
  • 12
1
vote
0 answers

Increasing byte counter for influxdb

I have a bytes counter being sent to InfluxDB and the below query to show the data: from(bucket: "PolygonIoStreamTelemetry") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) => r["_measurement"] == "bytes-received" or…
morleyc
  • 2,169
  • 10
  • 48
  • 108
1
vote
1 answer

How to connect to influxDB in version 2.0

After running influxd daemon when I try to start influx as in older version I'm not able to connect any CLI interface for DB. Instead it is showing help commands. Can anyone please help here
1
vote
1 answer

InfluxDB 2.0 unexpected token trying to group by time

So I have data in a bucket in InfluxDB 2.0 I'm in the "Data Explorer" and I'm trying to write a query to see the data that I have inserted. I'm trying a simple query, but I can't seem to make it work, even if I took an example from the…
Danielle Paquette-Harvey
  • 1,691
  • 1
  • 16
  • 31