It's working for me now. Got answer for this also from here
https://github.com/influxdata/kapacitor/issues/1139.
Thanks
On Wed, Jan 25, 2017 at 11:13 PM, wrote:
> I have tested this out locally and have not been able to reproduce. What
> version of Kapacitor are you using?
>
> I used this TIC
I have tested this out locally and have not been able to reproduce. What
version of Kapacitor are you using?
I used this TICKscript:
stream
|from()
.measurement('test')
|log()
|alert()
.crit(lambda: TRUE)
.message('{{index .Tags "com.docker.swarm.service.name"
Please require help here. Anyone got any idea?
Regards,
Aditya C S
On Sat 7 Jan, 2017, 1:41 PM Aditya C.S, wrote:
> *This is what I get in kapacitor logs*
>
> [batch_container_cpu_alert:log3] 2017/01/07 08:06:43 I!
> {"name":"service_cpu_usage","tmax":"2017-01-07T08:05:20Z","group":"
> com.doc
*This is what I get in kapacitor logs*
[batch_container_cpu_alert:log3] 2017/01/07 08:06:43 I!
{"name":"service_cpu_usage","tmax":"2017-01-07T08:05:20Z","group":"
com.docker.swarm.service.name=jenkins","tags":{"
com.docker.swarm.service.name
":"jenkins"},"points":[{"time":"2017-01-07T08:05:20Z","
In that case I would recommend adding a `log()` node to your script to
examine the data before it hits the alert. For example, updating your
script to look similar to:
...
|log()
|alert()
.message('{{ .Level}}: {{ index .Tags "com.docker.swarm.service.name"
}} has high cpu usag
Sorry for the typo. I have tried {{ index .Tags "
com.docker.swarm.service.name" }}.
It's not working.
Thanks,
Aditya C S
On Sat 31 Dec, 2016, 11:25 PM Ross McDonald, wrote:
Does this not work?
{{ index .Tags "com.docker.swarm.service.name" }}
There is a space between 'index' and '.Tags'. Th
Does this not work?
{{ index .Tags "com.docker.swarm.service.name" }}
There is a space between 'index' and '.Tags'. The brackets need to be
together. And it looks like there is a typo with 'sswarm' (should be
'swarm').
On Fri, Dec 30, 2016 at 11:12 PM, Aditya C.S wrote:
> How to write custom m
How to write custom message with tag value of
"com.docker.swarm.service.name"?. Below is my script. However, tag value is
displayed as null in the alert. I even tried this way ".message('{{
.Level}}: { {index.Tags "[[com.docker.sswarm.service.name]]" }} has high
cpu usage: {{ index .Fields "cpu