Tick Script not working


Here is my Chronograf generated Deadman tick script

I have a group by but the text of the e-mail sent still contains no values for

and service

I am having a rough time trying to use the {{ index .Tags “fieldname”}} to extract the tag values to be incorporated in the e-mail body or subject

var db = ‘telegraf’

var rp = ‘autogen’

var measurement = ‘mongodb’

var groupBy = [‘host’, ‘hostname’, ‘service’]

var whereFilter = lambda: (“host” == ‘wwwww.homedepot.com’) AND (“hostname” == ‘xxxxxxx.homedepot.com’) AND (“service” == ‘yyyyy’)

var period = 1m


var name = ‘MongoDB Deadman’

var idVar = name + ‘:{{.Group}}’

var message = ’ Level: {{.Level}} hostname: {{ index .Tags “hostname” }} host: {{ index .Tags “host” }} service: {{ index .Tags “service” }}’

var idTag = ‘alertID’

var levelTag = ‘level’

var messageField = ‘message’

var durationField = ‘duration’

var outputDB = ‘chronograf’

var outputRP = ‘autogen’

var outputMeasurement = ‘alerts’

var triggerType = ‘deadman’

var details = ‘Level: {{.Level}}
hostname: {{ index .Tags “hostname” }}
service: {{ index .Tags “service” }}
host: {{ index .Tags “host” }}
ID: {{.ID}}
Name: {{.Name}}
TaskName: {{.TaskName}}
Group: {{.Group}}
Tags: {{.Tags}}
Level: {{.Level}}
Time: {{.Time}}
Fields: {{ index .Fields “hostname” }} {{ index .Fields “host” }}’

var threshold = 0.0

var data = stream

var trigger = data
|deadman(threshold, period)

|eval(lambda: “emitted”)
.keep(‘value’, messageField, durationField)
|eval(lambda: float(“value”))
.tag(‘alertName’, name)
.tag(‘triggerType’, triggerType)