Hi,
I don’t know if this is an issue or just down to how I’m trying to use Kapacitor templates but…I have noticed something strange when using the |window() node and casting new tags with |eval().
I convert fields to tags in my templates ready for an http endpoint to receive them, which is working fine. hwoever if i add a template with the window node the tags are added to the “columns” section of the output. If i remove the window now the tags appear in the tags section of payload.
|window()
.period(period)
.every(every)
.align()
|eval(lambda: float("capacity_bytes") / mb,
lambda: float("capacity_bytes") / mb,
lambda: string(float("capacity_bytes") / mb), // Var1
lambda: string(host), // Var2
lambda: string(source), // Alert Source
lambda: string(metric), // Metric that triggered the alert
lambda: string(unit), // unit type %, MB, GB
lambda: string(module), // Module - Nutanix
lambda: string(priority) // Alert priority. not to be confused with alert level
)
.as('capacity_bytes','capacity_tb','Var1','Var2','Source','Metric','Unit','Module','Priority')
.tags('Var1','Var2','Source','Metric','Unit','Module','Priority')
.keep('capacity_bytes','capacity_tb')
I’m not sure why this is happening and was wondering, is this something to do with how the templates work? Am i using |window incorrectly? or is this some kind of weird behviour that shouldn’t be happening? If this is normal, then fair enough. I’d just like to understand why this might be happening.
Thanks
edit: I can provide some log output, but it isn’t very pretty