Derivative not working in batch tick script kapacitor


I am using Derivative function to calcute bandwidth and send alert via kapacitor,

below is the query

|query(''' SELECT derivative(mean("bandwidth_in"), 1s) *8 as "value" FROM "router"."autogen"."cisco_router" where  host = '' and ( interface_name = 'XXX' or  interface_name = 'XXXXX')) AND time < now() GROUP BY time(1s)  ''')
    .groupBy(time(10s), *)

and when i try to save this tick script in chronograf i get below error.

failed to parse InfluxQL query: derivative aggregate requires a GROUP BY interval