# Adding source message to Notification

**URL:** <https://community.graylog.org/t/adding-source-message-to-notification/12887>\
**Category:** Graylog Central (peer support)\
**Created:** [November 21, 2019, 6:00pm UTC](https://community.graylog.org/t/adding-source-message-to-notification/12887 "2019-11-21T18:00:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![segjerdingen](https://avatars.discourse-cdn.com/v4/letter/s/7ea924/32.png) [@segjerdingen](https://community.graylog.org/u/segjerdingen)\
**Post date:** [November 21, 2019, 6:00pm UTC](https://community.graylog.org/t/adding-source-message-to-notification/12887/1 "2019-11-21T18:00:56Z")

</div>

I am attempting to create an email notification for an event that GrayLog is capturing. I am strugging to add details about the specific event that is being encountered. For example, if I include ${source.message} field, it doesn’t display the source message of the alert. How did I configure these notifications to include the source variables?

---

<div class="post-metadata">

**Author:** ![shoothub](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/shoothub/32/6412_2.png) [@shoothub](https://community.graylog.org/u/shoothub)\
**Post date:** [November 22, 2019, 7:20am UTC](https://community.graylog.org/t/adding-source-message-to-notification/12887/2 "2019-11-22T07:20:19Z")

</div>

You need to setup Alerts - Event Definitions - Edit - tab Notifications and tick checkbox below Message Backlog and input 1. It is a number of messages to be included in Notifications. This way you can use fields in interation using foreach for example:

```
${if backlog}
${foreach backlog message}
    ${message.message}
${end}
${end}

```

If you want to use own extracted fields use syntax:  
`${message.fields.username}`

and so on.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/graylog/original/3X/c/7/c7c09c6b5099570133d6502b83f50ba4430de5b6.png) [@system](https://community.graylog.org/u/system)\
**Post date:** [December 6, 2019, 7:20am UTC](https://community.graylog.org/t/adding-source-message-to-notification/12887/3 "2019-12-06T07:20:21Z")

</div>

Closed on December 6, 2019, 7:20am UTC

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