From 41a1dbeceba274f42142e376ef56f1a78557c536 Mon Sep 17 00:00:00 2001 From: Ian Fijolek Date: Thu, 10 Aug 2023 16:22:30 -0400 Subject: [PATCH] Add date format functions --- README.md | 20 +++++++++++++++++++- alert.go | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 52 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4e0a524..5345fe0 100644 --- a/README.md +++ b/README.md @@ -94,10 +94,28 @@ Also, when alerts are executed, they will be passed through Go's format function |`{{.AlertCount}}`|Number of times this monitor has alerted| |`{{.FailureCount}}`|The total number of sequential failed checks for this monitor| |`{{.LastCheckOutput}}`|The last returned value from the check command to either stderr or stdout| -|`{{.LastSuccess}}`|The ISO datetime of the last successful check| +|`{{.LastSuccess}}`|The datetime of the last successful check as a go Time struct| |`{{.MonitorName}}`|The name of the monitor that failed and triggered the alert| |`{{.IsUp}}`|Indicates if the monitor that is alerting is up or not. Can be used in a conditional message template| +To provide flexible formatting, the following non-standard functions are available in templates: + +|func|description| +|---|---| +|`ANSIC