I’m having a hard time getting either the alert time or the ‘offending’ value’s timestamp into the alert message.
I’m able to access the value using {{ index .Fields “value” }}, so I had assumed {{ index .Fields “time” }} would work too - but this throws an error. What is the correct way to obtain the timestamp, preferably in ‘human’ readable form like YYYY-MM-DD HH:MM:SS ?
Use {{.Time}}
, that will be human readable, but it is not possible to control which format is used.
Nathaniel, thanks again for the fast response.
Is there something like {{ .UnixTime }} or any other workaround to provide the timestamp on the alert?
Thanks
Thanks Milan,
Yes, we are using exactly what you answer…Also with now, to compare now vs time…
Thank you for your reply!