# Email Variabls to display HOSTNAME, IP, PROCESS, etc

**URL:** https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819
**Category:** Graylog Central (peer support)
**Created:** [June 17, 2019, 4:42pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819 "2019-06-17T16:42:01Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![CrazyCDN](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CrazyCDN](https://community.graylog.org/u/CrazyCDN)
#### Post date: [June 17, 2019, 4:42pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/1 "2019-06-17T16:42:01Z")

</div>

Hi there.

I’m rather new to Graylog v3, and I am in the midst of setting up email notifications based on EventID, which I have set up a few conditions already that trigger email alerts.

The email alerts are successfully delivered to my email address, however in attempt to customize the email alert, I am unable to figure out how to display parts of the message in the body of the email itself.

I’d like to include the HOSTNAME of the server of where the event originated, as well as the process name/path that was part of the trigger (part of the message)

Is this possible?

I’ve tried the following two, but it results in a blank output.

Message Source: {message.source} Message: {message.message}

Any help would be appreciated.

---

<div class="post-metadata">

### Author: ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)
#### Post date: [June 17, 2019, 4:51pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/2 "2019-06-17T16:51:26Z")

</div>

Looks like you are missing the $ and fields…

`${message.fields.message}`  
`${message.fields.source}`

---

<div class="post-metadata">

### Author: ![CrazyCDN](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CrazyCDN](https://community.graylog.org/u/CrazyCDN)
#### Post date: [June 17, 2019, 7:34pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/3 "2019-06-17T19:34:46Z")

</div>

Hi there.

Thanks for the reply. So I have entered in both of those variables and the data is blank in the notification.

Here’s the output: [https://i.imgur.com/Wy5IZLk.png](https://i.imgur.com/Wy5IZLk.png)

Here’s the configuration of the notification window:

> ##########  
> Alert Condition Title: ${alertCondition.title}  
> ##########
> 
> Source: ${message.fields.source}
> 
> Message: ${message.fields.message}
> 
> Date: ${check\_result.triggeredAt}
> 
> Alert Description: ${check\_result.resultDescription}
> 
> Triggered condition: ${check\_result.triggeredCondition}  
> ##########
> 
> ${if backlog}Last messages accounting for this alert:  
> ${foreach backlog message}${message}
> 
> ${end}${else}  
> ${end}

I’d like to note that I am logging 3 Windows Server boxes using GELF via UDP if that makes any difference.

---

<div class="post-metadata">

### Author: ![tmacgbay](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/tmacgbay/32/3878_2.png) [@tmacgbay](https://community.graylog.org/u/tmacgbay)
#### Post date: [June 17, 2019, 9:13pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/4 "2019-06-17T21:13:38Z")

</div>

I think these need to be encapsulated in the foreach as well. Here is an example working alert I am using that is similar to yours:

```
${foreach backlog message}
  ${if message.fields.cmg_body}
    TEST-ALERT: ${message.fields.cmg_body}
  ${else}
    TEST-ALERT: ${message.fields.message}
  ${end}
${end}

${if stream_url}
  Stream URL: ${stream_url}${end}
  ##########

  ${if backlog}
    Last messages accounting for this alert:
    ${foreach backlog message}
      ${message}
    ${end}
  ${else}
    <No backlog>
${end}
```

---

<div class="post-metadata">

### Author: ![CrazyCDN](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CrazyCDN](https://community.graylog.org/u/CrazyCDN)
#### Post date: [June 17, 2019, 9:52pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/5 "2019-06-17T21:52:23Z")

</div>

So I did that, and all I got was:

> Stream URL: Please configure ‘transport\_email\_web\_interface\_url’ in your Graylog configuration file.
> 
> ##########
> 
> ```
> <No backlog>
> 
> ```

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [June 18, 2019, 10:34am UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/6 "2019-06-18T10:34:17Z")

</div>

you only have access to the fields in the backlog section

Please re-read the Docs:

[http://docs.graylog.org/en/3.0/pages/streams/alerts.html#email-alert-notification](http://docs.graylog.org/en/3.0/pages/streams/alerts.html#email-alert-notification)

---

<div class="post-metadata">

### Author: ![CrazyCDN](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CrazyCDN](https://community.graylog.org/u/CrazyCDN)
#### Post date: [June 18, 2019, 1:29pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/7 "2019-06-18T13:29:51Z")

</div>

Why is it that I only have access to the fields in the backlog section?

---

<div class="post-metadata">

### Author: ![jan](https://sea2.discourse-cdn.com/flex016/user_avatar/community.graylog.org/jan/32/11_2.png) [@jan](https://community.graylog.org/u/jan)
#### Post date: [June 18, 2019, 1:55pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/8 "2019-06-18T13:55:31Z")

</div>

> Why is it that I only have access to the fields in the backlog section?

because it is written in that way … if you want to have something else, feel free to check Github if your wish is already given as feature request and if not, open a new.

> **[Issues · Graylog2/graylog2-server](https://github.com/Graylog2/graylog2-server/issues)**
>
> Free and open log management. Contribute to Graylog2/graylog2-server development by creating an account on GitHub.

---

<div class="post-metadata">

### Author: ![CrazyCDN](https://avatars.discourse-cdn.com/v4/letter/c/df705f/32.png) [@CrazyCDN](https://community.graylog.org/u/CrazyCDN)
#### Post date: [June 18, 2019, 2:09pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/9 "2019-06-18T14:09:24Z")

</div>

Thanks for your response! I just wanted to make sure it wasn’t me that was doing something wrong. If it’s a limitation to Graylog, I’m cool with that.

Thanks all. Have a good day!

---

<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: [July 2, 2019, 2:09pm UTC](https://community.graylog.org/t/email-variabls-to-display-hostname-ip-process-etc/10819/10 "2019-07-02T14:09:29Z")

</div>

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