I am trying to run the following nested query in Kapacitor, but get an error message :
failed to parse InfluxQL query: found (, expected identifier at line 2, char 39
var email_base = batch |query(''' SELECT count(*) as "cnt" FROM ( select payment_id, email_domain from "my_db"."autogen"."payment_attempts" GROUP BY payment_id ) ''') .period(14d) .every(10s) .groupBy(time(1d), 'email_domain') .offset(75d) .fill(0) |mean('cnt_amount') .as('amount_mean') email_base |log()
payment_attempt measurement may have multiple points with the same
payment_id tag. I need the number of unique email domains supplied in the same payment_id.
I try to adapt this InfluxDB query to kapacitor:
SELECT count(*) FROM (select * from payment_attempts GROUP BY payment_id) where time >= end_time and time <= start_time GROUP BY email_domain, TIME(1d);
How can I rewrite my TICK script to support this functionality?
Thank you very much!