过滤来自CustomEvent

时间:2018-12-13 05:43:28

标签: azure-application-insights

我将Azure数据透视图中的数据保存为自定义事件格式。 现在,我需要在网站上创建一个仪表板页面,该页面将从见解中提取数据并显示该数据的图形。 问题是如何根据保存在其中的数据从customEvents中过滤数据。例如基于自定义事件或自定义数据。

向我提供任何资源,从那里我可以看到$ filer,$ search,$ query的工作方式? 我在https://dev.applicationinsights.io/quickstart,但看起来还不够。

我尝试添加过滤器,例如 startswith(customEvent / name,'BotMessageReceived')https://dev.applicationinsights.io/apiexplorer/events中 但它不起作用。表示“运行查询时出了点问题”, 我有名称以BotMessageReceived开头的customEvents

谢谢 达维病毒

1 个答案:

答案 0 :(得分:2)

更新: 没有类似的运算符,如果您想将时间戳记用作过滤器,则应使用以下三种方法之一:

    customEvents 
    | where timestamp >= datetime('2018-11-23T00:00:00.000') and timestamp <= 
datetime('2018-11-23T23:59:00.000')


    customEvents
    | where tostring(timestamp) contains "2018-12-11"


    customEvents
    | where timestamp between(datetime('2018-11-23T00:00:00.000') .. 
datetime('2018-11-23T23:59:00.000') ) 

请使用此:

customEvents
| where name startswith "BotMessageReceived"

如果您使用上面提到的api,则可以使用:

    https://api.applicationinsights.io/v1/apps/Your_application_id/query?
query=customEvents | where name startswith "BotMessageReceived"

它在我这边工作。