# Alert Variables in email action - EQL

**URL:** <https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695>\
**Category:** SIEM\
**Created:** [February 18, 2021, 11:20am UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695 "2021-02-18T11:20:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jancodenew](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jancodenew](https://discuss.elastic.co/u/jancodenew)\
**Post date:** [February 18, 2021, 11:20am UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695/1 "2021-02-18T11:20:26Z")

</div>

Hello,

Can someone please help to add additional field to the alert variable? I have mentioned the Detection EQL rule logic below.

sequence with maxspan=5m  
[authentication where event.type == "authentication\_failure"] by user.name  
[authentication where event.type == "authentication\_failure"] by user.name  
[authentication where event.type == "authentication\_failure"] by user.name

I need to add the user.name field as a alert variable in email action body.

I have tried with below parameters and its not working.  
{{user.name}}  
{{context.user.name}}

Thanks and regards

---

<div class="post-metadata">

**Author:** ![Frank\_Hassanabad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frank_hassanabad/32/49255_2.png) [@Frank\_Hassanabad](https://discuss.elastic.co/u/Frank_Hassanabad)\
**Post date:** [February 19, 2021, 12:04am UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695/2 "2021-02-19T00:04:07Z")

</div>

Is this the same post? I responded to this one over here:

> [@SIEM Detection alerts - Additional field adding in notification placeholders](https://discuss.elastic.co/t/siem-detection-alerts-additional-field-adding-in-notification-placeholders/264247):
>
> Hi, How can i add additional fields in alert email action body in detection rules. I am using ELK 7.10. For eg: Need to include user.name and source.ip field in the rule alert in the body of alert email action. Rule Logic is: More than 3 authentication failure in 5min from same user. I have created this rule using Threshold option in Detections. Thanks

---

<div class="post-metadata">

**Author:** ![jancodenew](https://avatars.discourse-cdn.com/v4/letter/j/87869e/32.png) [@jancodenew](https://discuss.elastic.co/u/jancodenew)\
**Post date:** [February 22, 2021, 9:02am UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695/3 "2021-02-22T09:02:18Z")

</div>

I have tried with all following options and its not working. All are giving blank result.

{{context.alerts.0.user.name}}  
{{context.alerts}}  
{{context.rule.0.user.name}}  
{{user.name}}  
{{context.user.name}}

---

<div class="post-metadata">

**Author:** ![Frank\_Hassanabad](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/frank_hassanabad/32/49255_2.png) [@Frank\_Hassanabad](https://discuss.elastic.co/u/Frank_Hassanabad)\
**Post date:** [February 22, 2021, 5:32pm UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695/4 "2021-02-22T17:32:42Z")

</div>

You're on 7.10 though? That particular feature looks to be added in 7.11. I don't think on 7.10 you will be able to get the `context.alerts` fwiw compared to 7.11.

---

<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:** [March 22, 2021, 5:33pm UTC](https://discuss.elastic.co/t/alert-variables-in-email-action-eql/264695/5 "2021-03-22T17:33:07Z")

</div>

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