In the Tasks documentation are the following two statements:
In the vast majority of task use cases, once data is transformed, it needs to sent and stored somewhere. This could be a separate bucket with a different retention policy, another measurement, or even an alert endpoint (Coming).
• You cannot write to the same bucket you are reading from.
The statement in the first block is entirely correct and mentions writing to another measurement. But, the note bullet in the second block seems to suggest it’s not possible to calculate a third measurement from two source measurements and write the result back to the originating bucket.
Is this so? Why? We presently do this very thing in v1 using Kapacitor. In various TICK scripts, we calculate derived values from source measurements and write the result to another measurement in the same database. Surely this must be possible in v2, albeit mapped to buckets.
If the note bullet above is not true or is incomplete, what is the appropriate Flux means for writing the results of a calculation to a measurement in the same bucket as its inputs?
I’ve seen the
to() function documentation. The examples don’t show using
to() for writing to a new measurement. I assume that by specifying
_measurement among the columns that it should be possible.
- Is it possible in a Task to write a measurement to the same bucket from which the input measurements originated?
- If so, what is the proper usage of Flux to do so? Use
to()with an appropriate manipulation of