I’d like to write a generic task to downsample my values received by various telelgraf (I have a lot of stuff, it moves regularly, I can’t process all the fields by hand).
Naively I had written this:
data = from(bucket: "telegraf")
|> range(start: -task.every))
data
|> aggregateWindow(every: 10m, fn: mean)
|> to(bucket: "telegraf_10m")
but I have the error:
could not execute task run; Err: unsupported input type for mean aggregate: string: unsupported input type for mean aggregate: string
indeed, there can be some thongs… not easy to aggregate, I would just like to ignore them.
How can I do it? I would do something like this but I can’t find the syntax.
data = from(bucket: "telegraf")
|> range(start: -task.every)
|> filter(fn: (r) => (type(r._value) != "string"))
data
|> aggregateWindow(every: 10m, fn: mean)
|> to(bucket: "telegraf_10m")
Thank you in advance,