Use this tag for questions related to InfluxQL, an SQL-like query language for interacting with data in InfluxDB.
Questions tagged [influxql]
219 questions
1
vote
1 answer
Why is this simple influx select query returning an empty result?
Following from: https://stackoverflow.com/a/47459151/1663462
> use abcxyz;
Using database abcxyz
> INSERT cpu,host=serverA,region=us_west value=0.64
> SELECT * from abcxyz;
> SELECT cpu from abcxyz;
Why are the SELECT queries returning no…

Chris Stryczynski
- 30,145
- 48
- 175
- 286
1
vote
1 answer
Modelling influxdb data into tags and fields
TL;DR
How to model data into fields vs tags incase you want to perform both group by and count(distinct())
So currently this is my influxdb data model:
api_requests (database)
- requests_stats (measurement)
- api_path (tag)
-…

Adarsh
- 3,273
- 3
- 20
- 44
1
vote
1 answer
Downscaling data while keeping host tag separate
I'm trying to downscale a bit of old data in influxdb. Basically, my measurements contain values from several different hosts, and I need to keep them separate. So, I'm trying to aggregate data to 5m intervals, but keep the host values separate.
I…

Steven De Groote
- 2,187
- 5
- 32
- 52
1
vote
1 answer
How to write case when query in influxdb?
I have a Grafana + InfluxDB + Telegraf setup to monitor my organization's servers. I want to make a dashboard in which I will be monitoring computer resources such as CPU , RAM etc of multiple servers. I want to show just '0', If my server processor…

adj009
- 329
- 1
- 5
- 16
1
vote
1 answer
Influx CLI execute does not find tags in the WHERE clause
I have a series that has some tags in them
> show tag keys on telegraf from mqtt_consumer
name: mqtt_consumer
tagKey
------
host
house_tag
sensorId
topic
and I am using a normal query that works OK within influx command line
select…

zpontikas
- 5,445
- 2
- 37
- 41
0
votes
0 answers
Grafana <> InfluxDB2 | Find the difference in query
I am using k6 (using xk6-output-influxdb) to write test results to InfluxDB2. However, I can't understand why the InfluxQL (A) and Flux (B) query return different results.
PS - group by fill(0), fill(null), etc doesn't make a difference if that…

zxcV32
- 74
- 1
- 4
0
votes
1 answer
How do I obtain a list of Tags from an InfluxDB Database
we are currently looking at migrating our company data historian over to InfluxDB. We have a Tag called 'tagname' and I would like to run a query to return a list of tagnames, how do I do this? Is this even possible? I have tried the following…

Paul Johnson
- 29
- 3
0
votes
0 answers
Can someone explain strange results of SQL (Sub-)Query on InfluxDB
In my influx db I have wrong data I need to update. Therefore I am looking for spikes in my data and I am using OFFSET and LIMIT in a divide and conquer algorithm to find this spikes.
Now I have strange results, that prevent my code/ queries from…

fuetty
- 3
- 2
0
votes
0 answers
Get one value before the timerange in InfluxDB
I have the below time series data in my measurement:
I'm receiving the below values from the user for the start and end time:
Start : '2023-06-12T06:20:00Z'
End : '2023-06-12T09:00:00Z'
On basis of the above parameters, I want this data to be…

Amey Meher
- 101
- 7
0
votes
0 answers
How do I specify a VSCode thunderclient POST Request to Query InfuxDB using InfluxQL
I am trying to get to grips with setting up a series of POST requests using Thunderclient in VSCode.
I have a cURL statement:
curl -X POST https://influxdburl/query
-u USERNAME:PASSWORD
-d "q=SELECT "value" AS "MyMeasurement" FROM…

Paul Johnson
- 29
- 3
0
votes
0 answers
InFluxQL remove items from result set
The query below returns several values
SELECT non_negative_derivative("signal_wait_time_ms", 1s)
FROM "sqlserver_waitstats" WHERE ("sql_instance" =~ /^$Instance$/)
AND $timeFilter GROUP BY…

Leo Torres
- 673
- 1
- 6
- 18
0
votes
0 answers
Calculate a SoC (battery) forecast with Flux / Grafana based on a known pv power generation and ac consumption
I need some help with forecasting my solar battery state of charge in Flux.
General information:
I have a pv solar system with battery, and all metrics are accessible via iobroker >> modbus >> influxdb.
So I know the current state of charge, as well…

Michael
- 1
0
votes
0 answers
Get last recorded value from influx if no entries in timespan
I am recording the value of a sensor to influx every time it changes. The frequency varies wildly. It may be every 30 seconds, or once every 2 weeks. It fluctuates based on environmental conditions. I do not have much control over this process.
I am…

Developer Gee
- 362
- 3
- 12
0
votes
0 answers
Alert handle based on multiple fields in kapacitor
I want to create alert in Kapacitor. I used http input plugin in telegraf to fetch data from endpoint after each 10 seconds. So telegraf fetched following data for each request:
{[{"id": "id1", "threshold": 100}, {"id": "id2", "threshold": 190},…

Rupesh Shinde
- 91
- 8
0
votes
0 answers
Influxdb - doing math with field by different tags
time
value(fileld)
type(tag)
object(tag)
1
5
a
X
1
7
b
X
2
3
a
X
2
2
b
X
My measurement looks like this. I want to create SELECT that returns me difference of values with tag "a" and values with tag "b" (they have the same time)…

Denethor II.
- 1
- 1