My downsampling task takes data from multiple hosts, and writes it to the downsampling-bucket associated with the same host names. All normal.
I want to create an exception, where data coming from a specific host-name, gets duplicated and written to the downsampling-bucket under two new host names.
Is there a way to duplicate/copying data while at the same time assigning it a new host name?
Or a way to integrate an if-else statement inside the to() function?
dummy code:
if r.host == "XYZ" then
// double up data and store it under two host names
|> to(bucket: "DOWNSAMPLE", host: "hostA")
|> to(bucket: "DOWNSAMPLE", host: "hostB")
else
// all regular hosts
|> to(bucket: "DOWNSAMPLE")
end
Thank you.
Yes, that would work.
I was hoping for a more stream-lined version, because I have a few different transformations further down the line, which I’d now have to duplicate on all the three branches.