Closed nixwiz closed 4 years ago
Looks good, but do we need documentation?
Yeah, I didn't see templating in the docs at all. An opportunity to add it now, I guess?
We probably need it. Would you be able to add some?
I'll try to write something up.
@echlebek docs added.
This allows for making timestamps readable and formattable using Golang's time format in a template.
Using the example contained in the test:
"Check: {{ .Check.Name }} Entity: {{ .Entity.Name }} Executed: {{(UnixTime .Check.Executed).Format \"2 Jan 2006 15:04:05\"}} !"
When expanded becomes:
"Check: check-nginx Entity: webserver01 Executed: 10 Dec 2018 20:55:19 !"
Signed-off-by: Todd Campbell todd@sensu.io