Use this tag for questions related to InfluxQL, an SQL-like query language for interacting with data in InfluxDB.
Questions tagged [influxql]
219 questions
2
votes
2 answers
InfluxDB Error: default retention policy not set for database in grafana after influx update from 1 to 2
I have updated my Influx database and also mapped the databases. But now I get the following problem in Grafana:
InfluxDB Error: default retention policy not set for database
InfluxDB Error: not executed
What could be the reason? I get the values…

OlKo
- 23
- 3
2
votes
0 answers
Fetch row based on group and having in influxDB
I'm new at influxDB and trying to solve a query. Where I need to fetch rows based on group by field3 columns and having should count less than 300. I've written it in SQL but not able to fetch any data from influxDB.
select count(field1),…

Md Enayat
- 147
- 1
- 12
2
votes
1 answer
Counting and grouping in Grafana
Grafana noob with simple query results formatted as table:
SELECT "locales" FROM "postgresql" WHERE ("environment" = 'stage') AND $timeFilter
Time
locales
2022-03-17 15:31:00
en
2022-03-17 15:31:01
en-us
2022-03-17…

calipoop
- 792
- 9
- 31
2
votes
0 answers
Select Query with "less than" requirement doesn't work in InfluxDB Query Language
I use influxdb 1.7.9-1 with some databases and some measurements. Now i want to select datapoints in a specific time range from a measurement with filters for fields and one filter for a tag. The timerange is from 2022-01-31T00:00:01.129322Z to…

TaunTaun
- 21
- 3
2
votes
2 answers
Get the hours of a timestamp and display in grafana
For my Grafana panel i would like to extract and display the hours of a date from a given timestamp series
For example the timestamp 1628274040 which is 2021-08-06 18:20:40 (CET) i would like to only have "18:20:40" and display this comparable in my…

harrow
- 178
- 1
- 11
2
votes
0 answers
grafana+prometheus using influx DB
We have existing Grafana dashboards which use Prometheus as a source and query for data using PromQL.
Since we want to keep the data longer (e.g.: 2months) and data volume is quite significant, we switched Prometheus to Influx DB, using remote_write…

Lukasz Strzeszynski
- 41
- 2
2
votes
0 answers
How to optimize InfluxQL query to load all cores on Influxdb 1.8
I have an InfluxQL query (Influxdb 1.8) & it takes a lot of time for it to finish even on c5.4xlarge with Intel Xeon Platinum 8000 with Turbo CPU clock speed of up to 3.6 GHz + EBS io2 with 16k iops available.
But when I look at htop I see only 1…

GTXBxaKgCANmT9D9
- 276
- 4
- 12
2
votes
0 answers
if false, do nothing in tickscript
In tickscript the norwal way to do if else is in the following:
if(condition, true expression, false expression)
However, for the false expression, I want my code to do nothing as in the following:
if(condition, true print("that is true"), false…

smsms
- 27
- 6
2
votes
1 answer
Show measurement with similar name in influxdb
I have a influx database which contains more than 300 measurements. Some of these have similar names. Is there a way i can search the names of the measurements with similar string in the names. Does influx have any syntax similar to sql where i can…

data-bite
- 417
- 2
- 5
- 17
2
votes
1 answer
How to backfill a continuous query in InfluxDB?
I have a DB which has years of stored historical data.
My goal is to re-sample this data in 1m intervals and save to a different DB.
My understanding is that this is easily achievable with a continous query.
CREATE CONTINUOUS QUERY cq_name ON db_2…

Newskooler
- 3,973
- 7
- 46
- 84
2
votes
1 answer
Adding a tag to aggregated data in influxdb
I'm having trouble understanding how to add tags to data series as I do SELECT INTO queries. I have an Influxdb of the NYTimes COVID dataset where I've used the cases and deaths fields as fields and the state and county information as tags.
I can…

JudoWill
- 4,741
- 2
- 36
- 48
2
votes
0 answers
InfluxDB sum all latest value based on tag
I have a database with some DHCP metrics
Tags and examples:
Name, e.g. Server network
ScopeId, e.g. 10.10.10.0
Free, e.g. 1
InUse, e.g. 99
Reserved, e.g. 10
Percentage in use, e.g. 99%
The ScopeId is unique and the Name is not unique.
I'm trying…

user2782999
- 385
- 1
- 7
- 23
2
votes
1 answer
Apply a SUM function on the product of two fields in InfluxDB
I have the following query:
SELECT sum("field1" * "field2") FROM "my_db"."autogen"."data" GROUP BY time(1d) FILL(null)
In short I would like to perform the operation sum on the product of two fields field and field2.
The above query returns an…

Newskooler
- 3,973
- 7
- 46
- 84
2
votes
3 answers
`missing tag key` when inserting to InfluxDB with inserting with multiple tags
I created a new db mydb on Influxdb.
Next I did use mydb
When I run insert on my db, I run into error -
ERR: {"error":"unable to parse 'angle, userid=1, product=pname value=5.1': missing tag key"}
Here's the insert that I am running -
INSERT…

nkirit
- 379
- 2
- 4
- 13
2
votes
0 answers
Aggregate function sum() and count(Distinct()) takes more than minute to return result in influxsql
I am executing one influxSQL query which is returning result in more than 1 minutes.
Query :
select SUM(call_duration) as total_duration,Count(Distinct(recipient_id)) as total_recipients from xyz where target_id = '1';
Separate queries like…

jkamani
- 51
- 3