Kapacitor: Feature Request: Timezone function in tick scripts

Created on 5 Dec 2017  路  2Comments  路  Source: influxdata/kapacitor

I would LOVE a TZ function that allows me to shift the timestamp by timezone
maybe timeZone({{.Time}}, "+5") or timeZone({{.Time}}, "AMERICA_NY")

In my tick script, I currently set the message to this:
var message = 'Alert fired @ {{.Time}}'
which yields this alert in slack:
Alert fired @ 2017-12-05 07:19:00 +0000 UTC which would be more helpful if I can set the TZ.

Bonus: A function that formats the timestamp, but that's less important.

Possibly related:
https://github.com/influxdata/kapacitor/issues/1014

If you can give me some pointers, and this feature is desired, I'll happily work on a PR for this.

Most helpful comment

This would be an awesome addition to K. Here in Tasmania, Australia we have a script that pulls out 10cm depth soil temperature readings at 9:00AM from Influx (important for fertiliser application decisions). Our servers are located in the US so I need to use an local time adjusted 'hour'. Would be great to be able to use TZ('Australia/Hobart') like we can in InfluxQL.

All 2 comments

This would be an awesome addition to K. Here in Tasmania, Australia we have a script that pulls out 10cm depth soil temperature readings at 9:00AM from Influx (important for fertiliser application decisions). Our servers are located in the US so I need to use an local time adjusted 'hour'. Would be great to be able to use TZ('Australia/Hobart') like we can in InfluxQL.

Yes please! Would be great to match working hours during the whole year both when legal time is applied and when not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ygtzf picture ygtzf  路  5Comments

seletskiy picture seletskiy  路  3Comments

qi-zhou picture qi-zhou  路  7Comments

phemmer picture phemmer  路  5Comments

seb-koch picture seb-koch  路  5Comments