Graylog notifications - Email body trouble

Hi everyone,

I’ve got an issue with the email body. I tried to get some message fields in the email body. See the code :

##########
Stream title: ${stream.title}
${if stream_url}Stream URL: ${stream_url}${end}

Triggered condition: ${check_result.triggeredCondition}
##########

${if backlog}Last messages accounting for this alert:{foreach backlog message}
Message:
Event : ${message.fields.EventID}
Subject : ${message.fields.SubjectUserName}
Target : ${message.fields.TargetUserName}
{end}{else}
${end}

But when i receive an email, here what i’ve got :

##########

Stream title: LDAP

Stream URL: URL to Stream
Triggered condition: 9b61feea-a13f-4707-8a73-dcaf6075b4d7:field_content_value={field: TargetUserName, value: Admins du domaine, grace: 0, repeat notifications: true}, stream:={5c40600551808f03b929d627: "LDAP"} ##########

Last messages accounting for this alert:{foreach backlog message}

Message:

Event :

Subject :

Target :

{end}{else}

Have an idea how this work ?

PS : I’ve put “1” in the field Message Backlog in conditions settings.

missing a few $… at the start of ${ foreach… , with ${end} and ${else} Here is one of my alert notifications (with custom fields):

${foreach backlog message}
${if message.fields.cmg_body}
ALERT: 
${message.fields.cmg_body}
${else}
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}
1 Like

Thank you so much ! It works !

1 Like

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