mbahaa
(Mohamed Bahaa)
August 29, 2018, 7:30pm
1
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}
jan
(Jan Doberstein)
August 30, 2018, 5:52am
2
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
mbahaa
(Mohamed Bahaa)
August 30, 2018, 12:58pm
3
Thx Jan for your response; HYG
==========================
########## 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}
*******.@
*******.@
Graylog alert for stream: {stream.title}: {check_result.resultDescription}
<empty>
==========================
jan
(Jan Doberstein)
August 30, 2018, 1:46pm
4
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}
mbahaa
(Mohamed Bahaa)
September 1, 2018, 8:19pm
5
Yes I’d edited the template to have the log message field in the notification
jan
(Jan Doberstein)
September 2, 2018, 10:57am
6
how does your message template look like exactly?
mbahaa
(Mohamed Bahaa)
September 2, 2018, 2:08pm
7
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}
mohamed.bahaa@etisalatdata.net
mohamed.bahaa@etisalatdata.net
Graylog alert for stream: {stream.title}: {check_result.resultDescription}
<empty>
=======================================================================
frantz
September 3, 2018, 8:29am
8
Do you set a backlog in the alert configuration ? because if backlog is set to 0 the notification can’t get any message.
mbahaa
(Mohamed Bahaa)
September 3, 2018, 12:05pm
9
i’d removed the backlog setting from the alert configuration (as in below snapshot); but still message field is empty
*
frantz
September 3, 2018, 2:37pm
10
The screenshot shows alert notification settings. Could you provide a screenshot of alert condition settings ?
jan
(Jan Doberstein)
September 13, 2018, 9:11am
12
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
mbahaa
(Mohamed Bahaa)
September 16, 2018, 9:26am
13
thanks for your support, but could you please elaborate more; shall i add the part you mentioned in configuration; & where exactly please?
mbahaa
(Mohamed Bahaa)
September 16, 2018, 9:53am
14
Thx Jan
i added the part into my Condition & found the message content
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
jan
(Jan Doberstein)
September 16, 2018, 10:24am
15
mbahaa
(Mohamed Bahaa)
September 18, 2018, 12:49pm
16
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?
jan
(Jan Doberstein)
September 18, 2018, 2:47pm
17
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.
system
(system)
Closed
October 2, 2018, 2:47pm
18
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.