Combining "offset", "period" AND "shift" in a batch script

kapacitor

#1

Hi,

I’m trying to make a tick script to compare the value of a specific metric against the same metric 2 days before, for instance.

In InfluxQL it would be as easy as:

Mean yesterday:

SELECT mean(“errors”)
FROM “x”.“y”."z"
WHERE time > now()-24h

Mean of the 48h before yesterday

SELECT mean(“errors”)
FROM “x”.“y”."z"
WHERE time > now()-72h AND time < now()-24h

When it comes to do that in Kapacitor, I have doubts to build the second query. How would you combine “offset”, “period” properties of from() node, plus “shift” node to achieve the same result as in the second query above these lines?

Thanks in advance