Logic Machine Forum
Influxdb read and write to LM object - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: Influxdb read and write to LM object (/showthread.php?tid=4400)



Influxdb read and write to LM object - thomasoppida - 25.11.2022

Hello,

I am looking for a script that reads from InfluxdbV2 bucket with a flux query and write the result to a LM group object. 
Has anybody done this?

Flux query example:

from(bucket: "HR7")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: ® => r["_measurement"] == "Platerigg")
  |> filter(fn: ® => r["Component"] == "Mettler")
  |> filter(fn: ® => r["Name"] == "Vekt")
  |> filter(fn: ® => r["Position"] == "Platerigg")
  |> filter(fn: ® => r["_field"] == "Mettler:AI01")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")


Kind reagrds
Thomas


RE: Influxdb read and write to LM object - admin - 25.11.2022

This thread has some examples that can be modified for your use case: https://forum.logicmachine.net/showthread.php?tid=1531