你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

ABSBotRequests 表的查询

有关在 Azure 门户中使用这些查询的信息,请参阅 Log Analytics 教程。 有关 REST API,请参阅查询

客户端到 Direct Line 通道

客户端到 Direct Line 通道请求的日志。

// All the API calls that clients make to Direct Line channel
// e.g. Generate a Token, Refresh a Token, Post an Activity, Get Activities, GetAttachments, etc.
// You can adjust the limit value to the number of logs you would like to retrieve.
ABSBotRequests
| where OperationName contains "ClientToDirectLine"
| sort by TimeGenerated desc
| limit 100

机器人到渠道

机器人到通道的请求的日志。

// This shows logs of requests sent by the bot to Azure Bot Service channels.
// You can adjust the limit value to the number of logs you would like to retrieve.
ABSBotRequests
| where OperationName contains "BotToChannel"
| sort by TimeGenerated desc
| limit 100

渠道到机器人

通道到机器人的请求的日志。

// This query retrieves logs of requests sent from Azure Bot Service channels to the bot.
// You can adjust the limit value to the number of logs you would like to retrieve.
ABSBotRequests
| where OperationName contains "ChannelToBot"
| sort by TimeGenerated desc
| limit 100

从 Facebook 到 Azure 机器人服务的请求

从 Facebook 到 Azure 的请求日志机器人服务 Facebook 频道。

// To retrieve logs for another channel, replace FacebookToChannel with the respective channel request operation name 
// e.g. SlackToChannel, KikToChannel, GroupmeToChannel, LineToChannel, SMSToChannel, TelegramToChannel and EmailToChannel.
ABSBotRequests
| where OperationName contains "FacebookToChannel"
| sort by TimeGenerated desc

从 Azure 机器人服务到 Facebook API 的请求

从 Azure 机器人服务 Facebook 通道到 Facebook API 的请求日志。

// To retrieve logs for another channel, replace ChannelToFacebookAPI with the respective channel request operation name 
// e.g. ChannelToSlackAPI, ChannelToGroupmeAPI, ChannelToKikAPI, ChannelToLineAPI, ChannelToSMSAPI, ChannelToTelegramAPI and ChannelToEmailAPI.
ABSBotRequests
| where OperationName contains "ChannelToFacebookAPI"
| sort by TimeGenerated desc

从客户端发送到 Direct Line 的活动

将活动从客户端发送到 Direct Line 通道的请求的日志。

// This query displays logs of requests sent from a client such as WebChat to Direct Line channel.
// Replace 'SendAnActivity:ClientToDirectLine' with any operation name whose logs you would like to retrieve.
ABSBotRequests
| where OperationName == 'SendAnActivity:ClientToDirectLine'
| sort by TimeGenerated desc

Direct Line 通道日志

检索与 Direct Line 通道关联的日志。

// This query retrieves logs of requests related to Direct Line channel.
ABSBotRequests
| where Channel == "directline"
| sort by TimeGenerated desc

失败的请求数

失败请求的日志列表。

// Retrieve all logs of requests that have not been successful within a selected time range.
ABSBotRequests
| where ResultCode < 200 or ResultCode >= 300
| sort by TimeGenerated desc

Direct Line 通道响应代码折线图

显示 Direct Line 通道请求响应代码的折线图。

// This query displays a Line Chart showing requests related to Direct Line channel.
ABSBotRequests
| where Channel == "directline"
| summarize Number_Of_Requests = count() by tostring(ResultCode), bin(TimeGenerated, 5m)
| render timechart

请求持续时间折线图

显示每个操作的请求响应时间/持续时间的折线图。

// This query displays a Line Chart showing requests response duration per operation.
ABSBotRequests
| summarize DurationMs = avg(DurationMs)  by bin(TimeGenerated, 5m), OperationName
| render timechart

响应代码折线图

显示请求响应状态代码的折线图。

// Display a Line Chart of requests response status codes.
ABSBotRequests
| summarize Number_Of_Requests = count() by tostring(ResultCode), bin(TimeGenerated, 5m)
| render timechart

响应代码饼图

显示请求响应状态代码的饼图。

// Display a Pie Chart showing requests response status codes.
ABSBotRequests
| summarize count() by tostring(ResultCode)      
| render piechart

请求操作饼图

显示请求操作的饼图。

// Display a Pie Chart showing requests by operation name.
// This gives a perspective of the request operations percentage distribution in the selected time range.
ABSBotRequests
| summarize count() by tostring(OperationName)      
| render piechart