# Kibana alerts

**URL:** https://discuss.elastic.co/t/kibana-alerts/321349
**Category:** Kibana
**Tags:** elastic-stack-alerting
**Created:** [December 15, 2022, 8:27pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349 "2022-12-15T20:27:58Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Anandhu\_R\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandhu_r_k/32/114780_2.png) [@Anandhu\_R\_K](https://discuss.elastic.co/u/Anandhu_R_K)
#### Post date: [December 15, 2022, 8:27pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/1 "2022-12-15T20:27:58Z")

</div>

Hi Team,

I have an elasticsearch query type rule configured for my index to detect certain fields with particular values. Also i have an corresponding email connector configured in which I am configuring my custom content using {{context.hits}}. So to achieve this custom content i need to get the very first occurred timestamp of the hits to be displayed in the email content, for which i tried using {{context.hits.0.\_source.@timestamp}} which is returning only the recent timestamp from the hits.

I want my email content to have the timestamp of first occurred event from the hits.

---

<div class="post-metadata">

### Author: ![bhavyarm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bhavyarm/32/22392_2.png) [@bhavyarm](https://discuss.elastic.co/u/bhavyarm)
#### Post date: [December 21, 2022, 10:51pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/2 "2022-12-21T22:51:01Z")

</div>

@ying.mao / @Patrick_Mueller can we please get some help?

Thanks,  
Bhavya

---

<div class="post-metadata">

### Author: ![ying.mao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ying.mao/32/88151_2.png) [@ying.mao](https://discuss.elastic.co/u/ying.mao)
#### Post date: [December 22, 2022, 1:12pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/3 "2022-12-22T13:12:36Z")

</div>

@Anandhu_R_K We use the mustache library for action templating and unfortunately, there is not a way to get the last element of an array using mustache, which is what we would want in this scenario.

---

<div class="post-metadata">

### Author: ![Anandhu\_R\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandhu_r_k/32/114780_2.png) [@Anandhu\_R\_K](https://discuss.elastic.co/u/Anandhu_R_K)
#### Post date: [December 22, 2022, 1:47pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/4 "2022-12-22T13:47:02Z")

</div>

@ying.mao Can we expect this feature for getting the last element of an array in upcoming releases.

---

<div class="post-metadata">

### Author: ![ying.mao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ying.mao/32/88151_2.png) [@ying.mao](https://discuss.elastic.co/u/ying.mao)
#### Post date: [December 22, 2022, 2:28pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/5 "2022-12-22T14:28:06Z")

</div>

@Anandhu_R_K We do have some updates to our action templating on our roadmap but we do not have a specific version we're targeting yet. You can follow this meta issue for updates: [[Alerting][Discuss] meta issue on mustache templating and action parameter processing · Issue #79786 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/79786)

---

<div class="post-metadata">

### Author: ![Anandhu\_R\_K](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/anandhu_r_k/32/114780_2.png) [@Anandhu\_R\_K](https://discuss.elastic.co/u/Anandhu_R_K)
#### Post date: [December 22, 2022, 3:03pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/6 "2022-12-22T15:03:49Z")

</div>

Sure, Thank You @ying.mao @bhavyarm

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [January 19, 2023, 3:04pm UTC](https://discuss.elastic.co/t/kibana-alerts/321349/7 "2023-01-19T15:04:38Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
