${message.message} not working in the alert template

Dears,

please support me as i can’t find out for the below scripts used in the Notifications template

message id: {message.id} message : {message.message}
message source}: {message.source} timestamp: {message.timestamp}
message fields: ${message.fields}

please share the complete notification setting you like to use.

In addition the documentation might help: http://docs.graylog.org/en/2.4/pages/streams/alerts.html#notifications

Thx Jan for your response; HYG

==========================

  • body:

########## Alert Description: {check_result.resultDescription} Date: {check_result.triggeredAt} Stream ID: {stream.id} Stream title: {stream.title} Stream description: {stream.description} Alert Condition Title: {alertCondition.title} {if stream_url}Stream URL: {stream_url}{end} Triggered condition: {check_result.triggeredCondition} ########## message id: {message.id} message : {message.message} message source}: {message.source} timestamp: {message.timestamp} message fields: {message.fields} ########## {if backlog}Last messages accounting for this alert: {foreach backlog message}{message} {end}{else}<No backlog> ${end}

  • email_receivers:

*******.@

  • sender:

*******.@

  • subject:

Graylog alert for stream: {stream.title}: {check_result.resultDescription}

  • user_receivers:

<empty>

==========================

what you provide does not look like the template from the notification configuration. The default looks like this:

##########
Alert Description: ${check_result.resultDescription}
Date: ${check_result.triggeredAt}
Stream ID: ${stream.id}
Stream title: ${stream.title}
Stream description: ${stream.description}
Alert Condition Title: ${alertCondition.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}

${end}${else}<No backlog>
${end}

Yes I’d edited the template to have the log message field in the notification

how does your message template look like exactly?

HYG

this means that i only add the below part in addition to the default teamplate

##########

message id: {message.id} message : {message.message}
message source}: {message.source} timestamp: {message.timestamp}
message fields: ${message.fields}

##########

========================================================================
body:

########## Alert Description: {check_result.resultDescription} Date: {check_result.triggeredAt} Stream ID: {stream.id} Stream title: {stream.title} Stream description: {stream.description} Alert Condition Title: {alertCondition.title} {if stream_url}Stream URL: {stream_url}{end} Triggered condition: {check_result.triggeredCondition} ########## message id: {message.id} message : {message.message} message source}: {message.source} timestamp: {message.timestamp} message fields: {message.fields} ########## {if backlog}Last messages accounting for this alert: {foreach backlog message}{message} {end}{else}<No backlog> ${end}

  • email_receivers:

mohamed.bahaa@etisalatdata.net

  • sender:

mohamed.bahaa@etisalatdata.net

  • subject:

Graylog alert for stream: {stream.title}: {check_result.resultDescription}

  • user_receivers:

<empty>

=======================================================================

Do you set a backlog in the alert configuration ? because if backlog is set to 0 the notification can’t get any message.

i’d removed the backlog setting from the alert configuration (as in below snapshot); but still message field is empty

*image

The screenshot shows alert notification settings. Could you provide a screenshot of alert condition settings ?

sorry for delay

HYG

the message information from the backlog are only available in the foreach loop

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

${end}${else}<No backlog>
${end}

1 Like

thanks for your support, but could you please elaborate more; shall i add the part you mentioned in configuration; & where exactly please?

Thx Jan

i added the part into my Condition & found the message content :grinning:

could you please provide me with a document including all syntax options like : ({foreach backlog message}{message})

to be able to use all available features

just look at the official documentation: http://docs.graylog.org/en/2.4/pages/streams/alerts.html

Hi Jan,

i tried to check the documentation but couldn’t reach the proper way to get separated display method for example: for (message.fields, message.source …etc.)

can you help please?

image

could you please share your alert body in a way I can copy&paste work with that. Using the image is not a way I can easily modify your given information.

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