Closed thiennt9295 closed 6 years ago
Hi issuecreator,
which version of the plugin do you have? I assume v2.0?
The release v2.0 implements the template engine according to the graylog documentation (read it for an explanation on how to use it). Your template is not valid since you can't directly access a messages field this way.
An alert is not triggered by one message only but can instead be triggered by no message at all or even multiple ones, this is why all the messages are stored in the backlog
variable. This means that to print the source
and facility
of each message you have to loop over the backlog:
[${stream.title}](${stream_url}): ${alert_condition.title}
```
${foreach backlog message}
Message: ${message.message}
Source: ${message.source}
Facility: ${message.fields.facility}
Streamurl: ${stream_url}
${end}
```
Also: don't forget the surrounding ``` since the message could contain markdown characters that are used for formatting telegram messages, this way the text is formatted as a code block.
HI @irgendwr If i keep fomat as above, i can't receive message, i get error below:
at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.run(DefaultBotSession.java:187) [telegram-alert.jar:?]
2018-03-20T00:55:10.699Z ERROR [Telegram Bots Api] BOTSESSION
org.telegram.telegrambots.exceptions.TelegramApiRequestException: Error getting updates
at org.telegram.telegrambots.api.methods.updates.GetUpdates.deserializeResponse(GetUpdates.java:119) ~[telegram-alert.jar:?]
at org.telegram.telegrambots.updatesreceivers.DefaultBotSession$ReaderThread.getUpdatesFromServer(DefaultBotSession.java:256) ~[telegram-alert.jar:?]
You have v1.0, download the latest release.
No, i installed v2.x, lastest. Version: 2.4.3+2c41897, codename Wildwuchs Help me, Thanks.
I'm not talking about your graylog version, but the version of my plugin.
Great @irgendwr Thanks,
Hi author,
I try send field message from Graylog to telegram, but i recieve null or no value message. Ex. %streamTitle%: %backlog%
Telegram recieved: