You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello everyone. I've encountered an issue while using the toTime function in templates for sending messages on Telegram (templateFiles) with Alertmanager v0.26.0.
I need to format the StartAt time as "29/07/2022 09:42:29". Previously, when using an external bot, this worked like this, and there were no issues:
Date: {{ $val.StartsAt | str_FormatDate }}
I tried changing the function to toTime, which resulted in an error:
err="failed to parse templates: template: alerts.tmpl:31: function "toTime" not defined"
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello everyone. I've encountered an issue while using the toTime function in templates for sending messages on Telegram (templateFiles) with Alertmanager v0.26.0.
I need to format the StartAt time as "29/07/2022 09:42:29". Previously, when using an external bot, this worked like this, and there were no issues:
Date: {{ $val.StartsAt | str_FormatDate }}
I tried changing the function to toTime, which resulted in an error:
err="failed to parse templates: template: alerts.tmpl:31: function "toTime" not defined"
Looking through the repository, I can see that this function is not present:
https://github.com/prometheus/alertmanager/blob/v0.26.0/template/template.go#L170
I also see that it's present in Prometheus.
Is there a way to format the date in some manner?
Beta Was this translation helpful? Give feedback.
All reactions