I am using a Particle IOT controller that outputs a concatenated string of variables separated by “_”. I am having trouble parsing this string into separate variables and displaying them in influxdb cloud. Ultimately, I would like to be able to plot these variables against each other for analysis.
I can get the variables separated out into columns in a table but do not know where to begin on how to store these in influx db cloud as separate variables for analysis later.
I tried looking through this forum as well as searching the web but have not found any obvious things to try. Has anybody accomplished something similar and can point me in the right direction?
Output from Particle controller:
Initial attempt at a parsing query:
//necessary libraries to import
//select bucket and filter to correct string variable
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: ® => r["_measurement"] == “tag1=port”)
|> filter(fn: ® => r["_field"] == “PortOutputString”)
|> filter(fn: ® => r[“tag2”] == “output”)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
//table formatting - columns for each variable after parsing string
|> map(fn: ® =>
parts = strings.split(v: r[“value"], t: "”)
Currently I can output a table with columns for each variable separated out.