mirror of https://github.com/grafana/loki
add date time sprig template functions in logql label/line formatter (#4603)
* add date time sprig template functions in logql label/line formatter With date time sprig template functions, we will be able to filter test jobs which create time is 1 day before as the following: ``` {job="test"} | label_format nowEpoch=`{{(unixEpoch now)}}`,createDateEpoch=`{{unixEpoch (toDate "2006-01-02" .createDate)}}` | label_format dateTimeDiff="{{sub .nowEpoch .createDateEpoch}}" | dateTimeDiff > 86400 ``` * add documents for date time sprig template functions * resolve comments * add golang datetime layout doc reference * update CHANGELOG.md accordingly to include this PRpull/4612/head
parent
96130ae389
commit
1c7df620c4
Loading…
Reference in new issue