Hi,
I’ve asked this before but got no response. Hopefully someone on here might respond this time
I’m working with Kapacitor templates and need to pass a variable in to the message that is generated when an alert is created. This variable is the threshold value so i would end up with a message like “hostname is over the threshold of <threshold_value> with <current_value>”
If i try to create a template task with this line
var message = '{{index .Tags "esxhostname"}} - {{ index .Tags "vmname" }} VMware Memory Usage is over the threshold of ' + threshold + ' with a value of {{ index .Fields "usage_average" | printf "%0.2f"}}% Usage.'
I get the following error
Kapacitor: invalid TICKscript: Failed to handle left node: Failed to handle right node: Failed to handle node: Given node type is not valid evaluation node:
If i remove the the ' + threshold + '
section and try to define the alert it works perfectly.
Why doesn’t this work in the template? Can provide full script if wanted.
Phil