I am triggering an email to a Microsoft Teams channel with an alert when a message to the Azure AppInsights traces
table has a severity level of 3. I would like to be able to see the actual log message that triggered the alert.
I have read that I need to write a Logic App. But I have been unable to figure out how to get the actual log message from there.
Has anyone else done this? Are there any samples that anyone is aware of?
You can send Messages of Log using below design:
In alert, you will see condition , in the same way you can use this as a condition.
To run KQL query you need to send logs data to KQL clusters and then you can run KQL queries on logs from ADX Cluster. Now you can use the Output of the KQL query in Next HTTP Request to send messages to Teams Channel. To send messages to teams you need to create a incoming webhook.
Output:
Output in Teams channel
You can also send any output like below:
In place of outputs('Compose') you need to use like this :
Then:
In place of http trigger you need to use Recurrence trigger running for every second to check the condition for kql, this is how you can create alert in Logic apps with kql output.