Log Analitics查询以汇总dau明智的所有http错误计数

时间:2019-12-29 07:57:23

标签: http https azure-log-analytics

我们的项目中要求使用Azure Log-Analytics获取每日的http错误计数(http 4xx,5xx)。

请帮助。

天| http 403 | http 404 | http 500 | http 502 | total_error_count


18-Dec 2 0 1 2 1 6 19-Dec 3 4 1 1 1 10

PFB-详细的屏幕截图

谢谢, 杰克·史密斯

1 个答案:

答案 0 :(得分:0)

欢迎使用堆栈溢出。 :)

如果必须为每个http错误代码创建单独的列并将其附加到结果中,则必须利用summarize运算符,timespan函数和(extend运算符组)。 基本查询如下所示。

AAAA
| extend BBBB_column = xxxxxxx, CCCC_column = yyyyyyy
| summarize BBBB_count_column=count(BBBB_column), CCCC_count_column=count(CCCC_column) by date_column=dayofmonth(TimeGenerated)
| project date_column, BBBB_count_column, CCCC_count_column, sum_column=BBBB_count_column+CCCC_count_column

其中AAAA是表名,xxxxxxx和yyyyyyy是分别获取特定http错误代码的一些计算。

希望此信息有所帮助!干杯!