这是我提出的一个查询,它将提取知识库问题的 ID、用户键入的问题和知识库答案。如果它们来自同一会话,它还将多个问题联系在一起。
不过,我还没有找到一种方法来确定一种方法来获取与 id 相关联的知识库问题。
requests
| where url endswith 'generateAnswer'
| project id, url, sessionId = extract('^[a-z0-9]{7}', 0, itemId)
| parse kind = regex url with *'(?i)knowledgebases/'knowlegeBaseId'/generateAnswer'
| join kind= inner
(
traces
| extend id = operation_ParentId
| where message == 'QnAMaker GenerateAnswer'
| extend userQuestion = tostring(customDimensions['Question'])
| extend knowlegeBaseQuestionId = tostring(customDimensions['Id'])
| extend knowlegeBaseAnswer = tostring(customDimensions['Answer'])
| extend score = tostring(customDimensions['Score'])
)
on id
| where timestamp >= ago(10d)
| project knowlegeBaseId, timestamp, userQuestion, knowlegeBaseQuestionId, knowlegeBaseAnswer, score, sessionId
| order by timestamp asc