Kapacitor / How to use a tag with dots in it in an Alert?

Hi,

I wrote a TICK script, and I need to use one of the tag present in my data to define the ID of an alert.
Nothing really complicated there (already done it a few times) but the problem is that my tag contains dots in it, so it ends up generating a problem, because (as far as I understand) the Go templating system does not allow keys to have dots.
Exemples :
|alert()
.id(’{{ index .Tags “whatever”}}’)
=> works fine
|alert()
.id(’{{ index .Tags “my.tag.with.dots”}}’)
=> does not work

I can’t really change that tag name (it’s generated by the Docker Telegraf input plugin, which collect all the labels on a container and use it as a tag for the metric. That label is put by our orchestrator, so I can’t change it).
And the fact is that a tag with dots is totally allowed in InfluxDB, but unusable in a Kapacitor AlertNode… so might be considered as a bug ?

Does somebody knows of a possible workaround ?
I thought about using an alias for the tag, but didn’t find how to do it (if possible).
Of course, I already tried to escape the dots (using single and double backslashes), without success…

Any idea ?

Ok, so after a little mode research, the problem was not really in the template code, it works fine even with dots in key names.
The problem was in the use of the “Aterta” node, which doesn’t allow to have dots in keys (because it send JSON data, including the tags).
And as I am making a query using groupBy on the tag with dots, it was automatically added to the alert data.

I found a workaround to rename the tag which works fine :
data
|eval(lambda: “io.rancher.stack_service.name”)
.as(‘service’)
.keep()
.tags(‘service’)
|delete()
.tag(‘io.rancher.stack_service.name’)

My tag is then renamed without dots, and causes no problem to the alerta node.

Wouhou \o/