influxdata / influxdata/kapacitor

issue with template and batch node

Open
#1,867 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
2.4k
Forks
479
Avg merge
4d 16h
Merged PRs (30d)
4

Description

hello

wil will to "template" a working tikc script, for Kapacitor, I encouter issue with using variable in the SELECT cuase of a batch node:

here is some part of the script:

var measurement string
var groupBy string
var indicator string
var offset duration
var period duration
var every duration
var shift = offset
.....
var prev_period = batch
|query('SELECT mean(indicator), stddev(indicator) from .measurement(measurement)')
.groupBy('devaddr')
.offset(offset)
.period(period)
.every(every)
.align()
|shift(shift)

when trying to "load" the template , I've got

error reloading associated task xxxxxxxxxx: failed to parse InfluxQL query: found ., expected identifier at line 1, char 49

same error with .db(db).rp(.rp) with db and rp defined as var string.
same without the "."

any hints ?
thans in advance
( Kapacitor 1.4)

regards
Philippe

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the provided TICKscript template with a batch node and variable-based SELECT in Kapacitor 1.4. Trace template loading and InfluxQL parsing; no source file or test is named in the issue. Done means the intended variables parse correctly, or the limitation and supported syntax are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, data
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.