How to make alerts with telegram bot?

hi guys, i'm learning Elasticsearch but i stumble in this problem. i want to send an alert from elastic to telegram.

In short this is the result that i expect:

Untitled

i use webhook connector and this is the config

but the problem is what should i put in this action body?

when i try to fill the body with the script above, this error appear. The connector can run just fine if i put just empty brackets

but somehow i managed to send message with chat bot to telegram group using this url below, this url is the same with the url i use in connector config except i text parameter is removed

https://api.telegram.org/(bot token)/sendMessage?chat_id=(chat id)&text=testText

Thanks

Hello Martin,

I don't have any specific experience with connecting alerts with telegram bots, but I have used it with the webhook API interfacing with Slack. What I can tell you is that the structure of the keys portion of the JSON request made from Kibana is really dependent on what the receiving API expects. My best advice would be to review Telegram's docs and maybe see if they have a forum, discord, etc. for new devs. Once you've figured out the keys, then for the values you could start with some static values just to make sure things are working, then replace them with action variables (see docs).

Hope that helps!

Regards,
Aaron

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