Use this tag for questions related to InfluxQL, an SQL-like query language for interacting with data in InfluxDB.
Questions tagged [influxql]
219 questions
8
votes
1 answer
Merging different granularity time series in influxdb
I want to store trades as well as best ask/bid data, where the latter updates much more rapidly than the former, in InfluxDB.
I want to, if possible, use a schema that allows me to query: "for each trade on market X, find the best ask/bid on market…

John Dorian
- 1,884
- 1
- 19
- 29
7
votes
1 answer
InfluxDB Flux - Filter where field matches value
I'm using InfluxDB with Grafana, and I have a measurement called items with some tags and a field called itemType. I need to filter for rows where itemType is a certain string. The following InfluxQL query does exactly what I need:
SELECT * FROM…

APixel Visuals
- 1,508
- 4
- 20
- 38
6
votes
1 answer
When organising an InfluxDB database, which of these two approaches would be most preferred?
I am trying to decide how measurements should be organised in an InfluxDB the database (which I believe they call schema design and data layout) but I think this may be a more general database type question.
Let's say as a simple example that I am…

teeeeee
- 641
- 5
- 15
5
votes
2 answers
Fetch tag values for a measurement - influxDB
I am trying to fetch the tag values for a given measurement.
i have my measurement in influxDB as given below.
> select * from "EVENT_LIVE"
name: EVENT_LIVE
time GROUP_ID COUNT
---- -------------…

Siva Tharun
- 127
- 1
- 2
- 12
5
votes
0 answers
Influxdb GROUP BY time aggregates data on wrong time intervals or buckets
Recently, we were facing a very annoying issue with InfluxDB's GROUP BY time. It turns out that if we are trying to aggregate data for each 30d, InfluxDB aggregates our data by unexpected time buckets.
For example the following query:
SELECT…

Aladin
- 492
- 1
- 8
- 21
4
votes
1 answer
flux query very slow in compare to InfluxQL (10x slower)
I'm upgrading form influx1.x to influx2.x (updating queries from influxQL to Flux syntax).
For very simple queries, performance drops dramatically when I try to query more than 500,000 points and I'm not sure if there's anything I can do to improve…

Ali Ajouz
- 61
- 3
4
votes
1 answer
Finding the Sum based on Group using Flux Query - InfluxDB
I am trying to use flux query language to find the sum of a column based on a person.
If I have the following input table:
How can I use a Flux Query to obtain the following output table:
I have tried something like this so far but I get…

Dr.Dough
- 145
- 1
- 6
4
votes
1 answer
Thin out influx database time series / remove duplicates
I made a mistake while logging data to my influx database. Instead of logging every change of my sensors as a measurement point into the table, i accidently forced logging data every second. So, the most of them are basically the same and obviously…

harrow
- 178
- 1
- 11
3
votes
0 answers
InfluxDB Show FieldKey for specific columns
at the moment im using SHOW FIELD KEYS to get the data types all columns in influx, I am wondering how could I retrieve data types for specific columns only?
Current behavior:
SHOW FIELD KEYS FROM "database"."autogen"."measurement";
//Return all…

Luka Špoljarić
- 988
- 1
- 10
- 23
3
votes
1 answer
Subtract two queries results
Cannot find per the docs, and there is an old issue related to this.
It is possible to subtract the results of 2 queries?
Something like this in SQL:
(SELECT COUNT(*) FROM test - (SELECT COUNT(*) FROM test WHERE …)

Eyal Cohen
- 1,188
- 2
- 15
- 27
3
votes
1 answer
How can I select the data between some specific hours in a specific month?
I already have InfluxDB working and getting monitoring data about some services (the value is just 1 for up and 0 for down). For the management I need to select the values from the database that are in a specific month and either night time or day…

benny b
- 175
- 1
- 12
3
votes
1 answer
InfluxDB how to escape square brackets "["
I am querying influx D.B. as shown below,
select * from measurement where '/cda/stats/@name' =~ /cda\/stats.*/ limit 5;
Above query is working fine, but when i try to specify square brackets in the query string it is not working, for e.g.…

Ammad
- 4,031
- 12
- 39
- 62
3
votes
2 answers
Using InfluxDB difference function
I have some measurement data in my influxdb database which I can query with:
select * from E_real_con
name: E_real_con
time value
---- -----
1537920001044785525 | 57160036.00
1538006401069651036 |…

cmolitor
- 156
- 1
- 7
2
votes
1 answer
InfluxDB: Flux vs InfluxQL chart differences
I am trying to migrate from InfluxQL to Flux but when displayed in a chart I get strange results and I was not able to solve it.
InfluxQL query and chart:
SELECT mean("machine_temperature") FROM "machine" WHERE time >= 1677625200000ms and time <=…

StockBreak
- 2,857
- 1
- 35
- 61
2
votes
2 answers
influx: merging large database with select into fails. Alternatives?
influxdb 1.8.10
I have 2 databases which was originally one, but due to hardware limitations,I had to move to a new system and just started a new database there.
now i've upgraded to a new system and wants to merge these two again.
I've restored the…

bpoepen
- 45
- 1
- 7