Questions tagged [flux-influxdb]

Flux is designed to be usable, readable, flexible, composable, testable, contributable, and shareable. Its syntax is largely inspired by 2018’s most popular scripting language, Javascript, and takes a functional approach to data exploration and processing.

The following example illustrates querying data stored from the last hour, filtering by the cpu measurement and the cpu=cpu-total tag, windowing the data in 1 minute intervals, and calculating the average of each window:

from(bucket:"example-bucket")
  |> range(start:-1h)
  |> filter(fn:(r) =>
    r._measurement == "cpu" and
    r.cpu == "cpu-total"
  )
  |> aggregateWindow(every: 1m, fn: mean)
130 questions
0
votes
0 answers

mean()-function "loses" _time

in the question Take the median of a grouped set I asked how it's possible to get the mean() value of a set of measurements over time. Background: I am storing lighthouse-data. Each lighthouse-run is a measuring_point and belongs to a measurement.…
SPQRInc
  • 162
  • 4
  • 23
  • 64
0
votes
1 answer

Take the median of a grouped set

I am quite new to Flux and want to solve an issue: I got a bucket containing measurements, which are generated by a worker-service. Each measurement belongs to a site and has an identifier (uuid). Each measurement contains three measurement points…
SPQRInc
  • 162
  • 4
  • 23
  • 64
0
votes
1 answer

Calculate daily average on a sparse data in Flux

I manually enter data every ~1 month into a bucket. I'd like to calculate daily change between the entered numbers and display it on the graph. Seems all the operators are dependent on the data density, so the calculated values are no different than…
tomrozb
  • 25,773
  • 31
  • 101
  • 122
0
votes
0 answers

Query related to Org Permissions - creating custom level tokens

When Creating Custom level Token , there is an option to provide Read / Write permissions on “AllOrgs” Resources but there does not exist an option to select a particular “Org”. I have an usecase wherein we can have multiple orgs "comprising…
VS J
  • 9
  • 2
0
votes
0 answers

Combie two query results in grafana

I have what I had thought was a simple use-case, but its turning out to be quite difficult. I have 2 influxdb buckets, one that logs my electricity meter price, and day vs night rate, and another than logs the energy being imported. what I would…
John McGrath
  • 151
  • 1
  • 11
0
votes
1 answer

Merge table after a group without _time

Hello i'm trying to have a graph who give me the mean value of a time series by hour during x Days I've succeeded to have the mean value but now all value are in different table and i don't know how to merge the table. I've seen merge or union…
Ruokki
  • 869
  • 1
  • 7
  • 24
0
votes
1 answer

Use optional variable in dashboard

I using influxdb to create a dashboard and i have a variable define by import "influxdata/influxdb/schema" schema.tagValues(bucket: v.bucket, tag: "my-tag") I can use the variable in my dashboard with this example query. from(bucket: v.bucket) …
Ruokki
  • 869
  • 1
  • 7
  • 24
0
votes
2 answers

Finding the Count per field for a Window using Flux Query - InfluxDB

I am trying to display data where it aggregates by a field and displays count per a window. I'm struggling coming up with the syntax. Let's assume this is my data in InfluxDb: import "array" data = array.from(rows: [ {application: "ap1", time:…
obautista
  • 3,517
  • 13
  • 48
  • 83
0
votes
1 answer

How to formulate conditional flux query

My Influxdb 2 measurement contains a boolean field. I would like to formulate a query that outputs all rows where the field's value is true. An if condition in a filter line does not work. In detail: I have workout data that includes the boolean…
PiEnthusiast
  • 314
  • 1
  • 4
  • 19
0
votes
1 answer

Send HTTP POST request to InfluxDB manually with browser

Hello, I'm currently using grafana to visualize data from InfluxDB, and would like to use a hyperlink in form of a HTTP request from a dashboard to insert data into the database. Is something like this possible?
0
votes
0 answers

Flux InfluxDB query not working correctly

I'm using InfluxDB and telegraf to have a dashboard. InfluxDB v2.4.0 (git: de247bab08) build_date: 2022-08-18T19:41:15Z Telegraf 1.23.4 (git: HEAD 5b48f5da) My goal is to create a table with "firmware_version" for each "MCU". telegraf input is an…
0
votes
1 answer

Where do I set the tls-key, tls-cert flags for influxd service for influx V2.4?

Docs suggest to start the influxd service with influxd with the flags --tls-key --tls-cert to prevent this error influx ping Error: Get "https://localhost:8086/health": http: server gave HTTP response to HTTPS client I have created the keys and…
escargo
  • 3
  • 2
0
votes
1 answer

Computing Pearson Correlation in InfluxQL

I want to compute the Pearson correlation in InfluxDB. I found that there's a function for that in Flux. I am using Influx Query Language (InfluxQL). It is possible to compute the Pearson correlation in InfluxQL?
AbdelKh
  • 499
  • 7
  • 19
0
votes
2 answers

Influxdb2 flux's today() function using wrong timezone

This is my query: from(bucket: "power_monitor") |> range(start: today()) |> aggregateWindow(every: 1h, fn: mean, createEmpty: false) |> keep(columns: ["_measurement", "_value", "_time"]) |> increase() |> last() It tracks the amount of energy used…
jpx
  • 123
  • 2
  • 9
0
votes
2 answers

Influxdb2 How to Use windowPeriod in Arithmetic

I am trying to calculate my energy cost with datapoints published to my influxdb. I need to utilize windowPeriod in order to go back far enough in time. I am currently taking a sum of my energy usage and trying to do arithmetic on it, which if I use…
David Weber
  • 354
  • 1
  • 12
1 2 3
8 9