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
1 answer

Insight into heavy or currently-running queries on Influx v2.x

In my Influx v2.x setup, I have a process that is running frequent periodic queries that eat up a lot of resources. I want to identify the query that's executed, which may be coming from several consumers/apps. For example, in Influx v1.x you are…
Juliën
  • 9,047
  • 7
  • 49
  • 80
0
votes
1 answer

Creating Variable with Multiple Tags in InfluxDB2

How to create a Variable with multiple tags in Flux? import "influxdata/influxdb/schema" schema.measurementTagValues( bucket: "AUTOMATIONDB", measurement: "${MEASUREMENT}", tag: "${RUNID}", tag: "CATEGORY". ) The above query gives…
0
votes
1 answer

Influxdb 2 - how to get schema of a bucket?

How can i get a schema / list of existing fields, tags and measurements in particular bucket? I want to achieve this with using InfluxDB API or influxdb-client-js package in my JS app. Can it be done with proper query? Are there other options?…
szylkret
  • 1
  • 1
0
votes
1 answer

InfluxDb query to return the no of records in a given timespan

Im using time series analysis and I'm using influx db to plot interesting graphs. So here's the use case I'm building an IOT project to monitor my desk plant. every time the moisture goes down to 10%, I trigger to turn on the pump and register that…
0
votes
1 answer

Combining two different sources with different timestamps in influxdb/flux

I have 2 measurements as follows: metrics,app=app1 cpu=10 1654150510 metrics,app=app1 cpu=12 1654150512 metrics,app=app1 cpu=13 1654150514 metrics,app=app1 cpu=14 1654150516 metrics,app=app1 cpu=15 1654150519 The frequency of the "metrics"…
Vipin Menon
  • 2,892
  • 4
  • 20
  • 35
0
votes
0 answers

InfluxDb flux query: filter by time

I have this flux aggregation query from(bucket: db) |> range(start: dateFrom, stop: dateTo) |> filter(fn: (r) => r._measurement == tableName and (r._field == "value")) |> filter(fn: (r) => (r.sensorId == "sensor1") or…
Alex
  • 114
  • 5
0
votes
1 answer

Please correct flux query for grafa to calculate and display of a result for two columns AAA+BBB

// I'm using sequences for insreting in FluxDB: 'sever1,submeas=XXX AAA=899265', 'sever1,submeas=XXX BBB=2281289', 'sever2,submeas=XXX BBB=2672', 'sever2,submeas=XXX AAA=0', 'sever3,submeas=XXX AAA=947439', 'sever3,submeas=XXX BBB=897226' // …
0
votes
1 answer

Storing Laravel Logs using InfluxDb, Telegraf and Grok

I'm trying to centralize all Laravel logs using Telegraf and visualize them with Grafana. For now I can store logs with the following format: [2022-03-31 12:08:50] dev.INFO: microservice_name | default | Update User | 32 | mail@mail.com | Center…
0
votes
1 answer

How to get _value of two tables into one table?

I'm trying to create a dashboard where i can filter data by gas station location and fuel type. This is my Table from this query: from(bucket: "homeassistant") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) =>…
Niklas G.
  • 11
  • 1
0
votes
1 answer

Grafana Dashboard for Gatling-influxdb Setup

I am trying to import some readymade dashboard from grafana for my setup( gatling/influxdb) but those are not working somehow specially simulation parameter in grafana dashboard.if someone using same setup , can please share their json file. below…
0
votes
1 answer

Verification Gatling is sending events on Certain port

I am sending events through gatling using graphite protocol on default port 2003.All the set up is on local ( including influxdb and grafana as well).Now I want to verify in gatling logs that in actual events are passing through port 2003 .How to…
Perf2017
  • 29
  • 5
0
votes
1 answer

How to inner join two windowed tables in Flux query language?

The goal is to join tables min and max returned by the following query: data = from(bucket: "my_bucket") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) min = data |> aggregateWindow( every: 1d, fn: min, …
Moritz Wolff
  • 436
  • 1
  • 7
  • 16
0
votes
1 answer

Flux: InfluxDB conversion of a table from Float to Integer

Using InfluxQL with this query, one could convert a table from Float to Integer: SELECT value::integer INTO temp FROM measurement; DROP MEASUREMENT measurement; SELECT value::integer INTO measurement FROM temp; DROP MEASUREMENT temp; How can the…
Stefan
  • 21
  • 1
  • 5
0
votes
1 answer

Average of 2 Sums in Flux query in Influx

I need to calculate error rate the forumula is countError/count I have tried joining but kind of stuck what to do post that count = from(bucket: "stress") |> range(start: v.timeRangeStart, stop: v.timeRangeStop) |> filter(fn: (r) =>…
Ayansplatt
  • 51
  • 4
0
votes
1 answer

Grafana query to generate a cumulative sum from the same time every day

I need to present a Grafana time series graph starting at 05:00 every day. The time series graph needs to show a cumulative sum of 2 mass flow meters until 05:00 the next day, at which time it resets to zero, and then starts summing again. What I…
PierreV
  • 1
  • 3
1 2 3
8
9