Hello @Gamienator
To get an extra field/s in the notification you would need to adjust your Notification template.
If I can direct you to this part of the Notification template.
Fields:
${foreach event.fields field} ${field.key}: ${field.value}
${end}
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
${message}
${end}
Below is a demo for extra fields and full message. Please take note of the macros that are used.
Fields:
${foreach event.fields field} ${field.key}: ${field.value}
${end}
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
${message}
TargetUserName: ${message.fields.TargetUserName}
WorkstationName: ${message.fields.WorkstationName}
EventReceivedTime: ${message.fields.EventReceivedTime}
Source: ${message.fields.source}
Message Link: https://Graylog.domain.com:9000/messages/${message.index}/${message.id}
${end}
Click me
### This is the Full Template ###
--- [Event Definition] ---------------------------
Title: ${event_definition_title}
Description: ${event_definition_description}
Type: ${event_definition_type}
--- [Event] --------------------------------------
Timestamp: ${event.timestamp}
Message: ${event.message}
Source: ${event.source}
Key: ${event.key}
Priority: ${event.priority}
Alert: ${event.alert}
Timestamp Processing: ${event.timestamp}
Timerange Start: ${event.timerange_start}
Timerange End: ${event.timerange_end}
Fields:
${foreach event.fields field} ${field.key}: ${field.value}
${end}
${if backlog}
--- [Backlog] ------------------------------------
Last messages accounting for this alert:
${foreach backlog message}
${message}
TargetUserName: ${message.fields.TargetUserName}
WorkstationName: ${message.fields.WorkstationName}
EventReceivedTime: ${message.fields.EventReceivedTime}
Source: ${message.fields.source}
Message Link: https://Graylog.domain.com:9000/messages/${message.index}/${message.id}
${end}
${end}
To sum it up;
The full message ${message}
and then what follows is TargetUserName, WorkstationName, EventReceivedTime ,Source , and message link.
If the fields are in the message/logs you can grab anyone you want.
So for starters, you need to add message and fields then the field you would like
Example, should be something like this.
${message.fields.some_field}
Message link is nice to have also, the first part is you URL for Graylog Server then add /${message.index}
and /${message.id}
to the end. It would direct you to the message that was triggered from your email notification.
Example.
Message Link: https://Graylog.domain.com:9000/messages/${message.index}/${message.id}
Part #2
If you using HTML in the email you now need to configure your HTML Body Template which is below the Body Template. You have two choices, either remove the configuration of the HTML Body Template or configure it.
If you decide to configure it then from the example above you would need to configure this section
${if backlog}
<br /><table width="100%" border="0" cellpadding="10" cellspacing="0" style="background-color:#f9f9f9;border:none;line-height:1.2"><tbody>
<tr><th style="background-color:#e6e6e6;line-height:1.5">Backlog (Last messages accounting for this alert)</th></tr>
${foreach backlog message}
<tr><td>${message}</td></tr>
${end}
</tbody></table>
${end}
Example from the demo Notification template above. I would need to add something like this as shown below.
${if backlog}
<br /><table width="100%" border="0" cellpadding="10" cellspacing="0" style="background-color:#f9f9f9;border:none;line-height:1.2"><tbody>
<tr><th style="background-color:#e6e6e6;line-height:1.5">Backlog (Last messages accounting for this alert)</th></tr>
${foreach backlog message}
<tr><td>${message}</td></tr>
<tr><td>TargetUserName: ${message.fields.TargetUserName} </td></tr>
<tr><td>WorkstationName: ${message.fields.WorkstationName} </td></tr>
<tr><td>EventReceivedTime: ${message.fields.EventReceivedTime} </td></tr>
<tr><td>Source: ${message.fields.source} </td></tr>
<tr><td>Message Link: https://Graylog.domain.com:9000/messages/${message.index}/${message.id}</td></tr>
${end}
</tbody></table>
${end}
Hope that helps