Thanks for your reply but Iam not getting the value of machine_name in instance ie my alert looks like
Name of the machine : ' + instance + ' Machine Name ' + machine_name but I want to get Name of the machine : prod2 which is defined in json file On Thursday, November 10, 2016 at 10:43:32 PM UTC+5:30, nath...@influxdb.com wrote: > > There is an open issue to make this easier. > https://github.com/influxdata/kapacitor/issues/894 > > For now you can use string concatenation as a work around. > > For example > |alert() > ... > .message('{{ .ID }}, Level: {{ .Level }} , Alert Time : {{.Time}} > Instance: ' + instance + ' Machine Name ' + machine_name) > ... > > On Thursday, November 10, 2016 at 8:38:42 AM UTC-7, > vipul....@traveltriangle.com wrote: >> >> Hi all, >> I have the following tick template >> >> var instance string >> var machine_name string >> stream >> |from() >> .database('tech') >> .retentionPolicy('autogen') >> .measurement('passenger_queue') >> .where(lambda: "host" == instance) >> |log() >> |alert() >> .id('Passenger queue kapacitor alert') >> .message('{{ .ID }}, Level: {{ .Level }} , Alert Time : >> {{.Time}}') >> .details(''' >> <p>Name of the machine : {{ machine_name }}</p> >> <p>Length of passenger queue : {{ index .Fields "value" }} </p> >> ''') >> .info(lambda: "value" > 30) >> .warn(lambda: "value" > 45) >> .crit(lambda: "value" > 60) >> .stateChangesOnly() >> .email() >> >> my json file looks like this >> { >> "instance": {"type" : "string", "value" : "172.30.0.7" }, >> "machine_name": {"type" : "string", "value" : "prod2" } >> } >> >> >> is there a way to use machine_name variable in alert >> please help >> > -- -- Remember to include the version number! --- You received this message because you are subscribed to the Google Groups "InfluxData" group. To unsubscribe from this group and stop receiving emails from it, send an email to influxdb+unsubscr...@googlegroups.com. To post to this group, send email to influxdb@googlegroups.com. Visit this group at https://groups.google.com/group/influxdb. To view this discussion on the web visit https://groups.google.com/d/msgid/influxdb/750fba2f-4b9c-49f9-ad44-684e38b5bf1f%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.