Hello
I’m doing Opendisto alert integration with Microsoft teams through custom webhook.
How to create destination
specified full teams webhook URL in ‘Define endpoint by URL’
→ then alert doesn’t work
specify below items in ‘Define endpoint by custom attributes URL’ such as
type : HTTPS
Port 443
Path webhook/0ea528-blablabla…
Parameter : no parameter
Header : contents-Type application/json
→ it still doesn’t work
so wondering how to specify all custom attributes to make work with teams webhook
teams webhook itself is working by curl command
such as curl -H “Content-Type: application/json” -d “{"text": "Hello World"}” https://outlook.office.com/webhook/0ea528-blablabla…
Then I can see “Hello World” in teams channel.
you need format the message to match the what teams expects in the “actions” section of the trigger. For example flowdock requires the "event": "message" and "content":"your text here" values in it’s API request:
{ "event": "message" , "content": "{{ctx.monitor.name}} has detected an error
- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Alert URL: url" }
Hello ejohns81, thanks a lot for response.
But wondering how to configure all your suggestions in OpenDistro Destination page.
for example
event, content, Trigger, Severity,… text should be parameterized in ‘Add parameter’ ?
Hello dmmutch
Thanks a lot for your response.
What you’re saying is ‘how to configure actions in Alert’ with Destination (Errors - webhook)
What I need to know is ‘how to configure Destination with Microsoft team webhook’
Screen capture that I upload is for that.
You have a destination pointing to your Microsoft team webhook.
This webhook expects your message to be formatted a certain way otherwise it’ll reject it.
To do the formatting of the body POSTed to the webhook, you need to modify the action message as dmmutch has pointed out.
So after you create your destination. Head over to your monitor → trigger → alert and you can use dmmutch example above.
Hey dear, I too have the same issue. curl command send messages perfectly but kibana custom webhook not able to send any messages.
Let me know if you manage to find solution