azure monitor 和 azure application insights 查询

azure monitor and azure application insights query

我想弄清楚如何过滤甚至查看更多显示在 function/monitor 选项卡下的 azure 门户中的条目。我有 1000 条记录的日志,其中只有 20 条显示,我不知道如何配置你想在监视器选项卡下看到的内容。就像现在它显示 20 个日志,如果我想看到 40 个,我该如何设置?如果我想删除所有日志条目,我可以这样做吗?

另外,当我打开 Application Insights 时,那里设置的查询非常令人困惑,他们是否有任何关于如何学习查询结构的好文章。

我基本上只想在监视器和应用程序洞察中查看错误的详细信息,但不知道如何配置。

附上一张图,我怎么只能看到第一张图的错误,把所有的log去掉,重新来过。 第二张图我如何学习所使用的查询语言,我想查看日志中出现的异常,我如何才能看到那些

功能页面的监控选项卡,据我所知是预览界面。方便浏览最新日志。如果您想自定义日志输出,则必须转到 Application Insights 来定义查询。

至于你的要求,很容易定义。您只需要为查询添加限制。一种是将 take 增加到 40 或增加 | limit 40 。并用 | where success == "False" 添加一个限制。然后查询将如下图所示。

关于如何编写查询的更多详细信息,您可以参考本教程:Get started with Azure Monitor log queries

更新: 关于异常的最短查询可以是:exceptions | where cloud_RoleName =~ 'georgecfunction' and operation_Name == 'TimerTrigger1' | order by timestamp desc 并设置 custom Time range.

或者你这样设置exceptions | extend itemType = iif(itemType == 'exception',itemType,"") | where (itemType == 'exception' and (timestamp >= datetime(2019-05-19T01:13:00.000Z) and timestamp <= datetime(2019-06-18T01:13:00.000Z))) | where cloud_RoleName =~ 'georgecfunction' and operation_Name == 'TimerTrigger1' | order by timestamp desc