I am looking to export data to a vendor as it comes into our system. I was writing a kapacitor tickscript - but I cannot edit the structure of the json (slightly annoying) and am having difficulty getting it to post correctly.
Our DB is a big flat table (maybe not the best, but not my idea). We have 3 different sensors coming in (12 tags each sensor, total 36 tags). We need to constantly send the data to a vendor and kapacitor came up because it has a built in httppost function.
Problem:
First when i attempt to query and return the data, it only returns the first sensor (12 ish tags), but then returns blank rows for every other tag type. So i know its attempting, but i feel like there is a column limit in kapacitor or it cannot handle something I want it to do. Example (Fig1) below:
I can tell the lines are different because sn is common across 2 of them and is updating to the correct value. Then i started thinking "is this my lack of understanding of TSDBās thatās causing this?
So I thought, split this up into each sensor and do 3 separate kapacitor jobsā¦ super annoying and not what iām supposed to send, but maybe that worksā¦ However then it starts sending bad/duplicate subsets of data. It will randomly post with columns 1 and 2, then send the same data with every column. I want it to only post if it sends every column.
The downside of the second approach is that itās now 3 separate jsons because the post doesnāt have a join method on it for me to merge this all together. Can anyone lend some insight? Iām clearly in over my head with kapacitor and am slowly starting to explore options outside of influx altogether.
edit I feel like telegraf might even be a better choice here?
Ideally I want to make my own json structure in here, but thatās provingā¦ ridiculous. Otherwise if I can get all the data into one json, that would be ideal.
"columns": ["time", "SweepCount", "Uptime", "Uptime_1", "boardTemp", "measurement", "rh", "s0TempPost", "s0TempPre", "s0mag", "s0phase", "s1TempPost", "s1TempPre", "s1mag", "s1phase", "s2TempPost", "s2TempPre", "s2mag", "s2phase", "s3TempPre", "s3mag", "s3phase", "s4TempPost", "s4TempPre", "s4mag", "s4phase", "sn"],
"values": [
["2020-07-27T20:59:35.493Z", 118, 10271, 10271, 8681, "EQUIP1", 15.73, 88.1395, 90.3608, 16369700, -5.98295, 87.9217, 88.0523, 15466700, -3.69109, 87.4885, 87.6181, 13641500, -27.205, 87.4022, 3110180, -76.1478, 87.144, 87.5317, 34950.5, -81.1914, 1627],
["2020-07-27T20:59:35.533Z", null, null, null, null, "EQUIP1", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null],
["2020-07-27T20:59:35.563Z", null, 10365, 10365, 100, "EQUIP1", null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, 6237],