Hi, I am performing some operations on my data stream in Flux and I want to add new records in the middle of a table or optionally to a new table if a certain condition is met.
Example data:
_time,status
2023-05-28T00:00:29Z,online
2023-05-28T00:03:29Z,offline
2023-05-28T00:08:29Z,online
So let’s say that when “status” is “offline”, I would like to add a row with a timestamp a minute later (in this case 2023-05-28T00:04:29Z) and a “newColumn” column with the value “machine_offline” to this table or to some temporary table where I will store only these added rows and return them as the result of the query.
I thought map() could do this, but this function only allows to return one row, so I can’t return, for example, the union of the base row and the created.
Is there a way to somehow iterate over the table creating new row each time when this certain condition is met?