Graylog创建警报通知的问题

时间:2017-09-12 13:35:24

标签: graylog2

我使用此主题创建提醒 但我不明白为什么有些信息不发送。像这个变量$ {message.fields.name}和另一个类似的。

这是我的条件 enter image description here

我使用了这个模板

Date: ${check_result.triggeredAt}
Stream ID: ${stream.id}
Stream title: ${stream.title}
${if stream_url}Stream URL: ${stream_url}${end}

${if backlog}Last messages accounting for this alert:
${foreach backlog message}
Message: ${message.message}
Source: ${message.source}
Full Message: ${message.fields.full_message}
${end}${else}<No backlog>
${end}

并在我的邮件中有这个

##########
Alert Description: Dummy alert to test notifications
Date: 2017-09-11T18:48:33.664Z
Stream ID: 59b695542ab79c0001554b85
Stream title: New Stream
Stream description: Test notifications
Alert Condition Title: Test Alert
Stream URL: https://mysite

Triggered condition: d91e0fa5-867c-4cf1-bf0e-2b5d2fdd19f9:dummy={Dummy alert to test notifications}, stream:={59b695542ab79c0001554b85: "New Stream"}
##########
Message: Full Message:

如何创建此通知?

1 个答案:

答案 0 :(得分:0)

我不知道如何,但现在它的工作。

${if backlog}
You have new request: 
${foreach backlog message}
status: ${message.fields.status}
firstname: ${message.fields.name_first}
lastname: ${message.fields.name_last}
phone: ${message.fields.phone}
email: ${message.fields.email}
source: ${message.fields.source}
timestamp: ${message.fields.timestamp}
${end}
${else}
Empty backlog
${end}