简体   繁体   English

如何使用 Kusto 查询语言在 Azure 日志中显示具有多个自定义指标的时间表

[英]How do I display a timechart with more than one custom metric in Azure Logs with Kusto Query Language

I have the following Logs in Azure Logs:我在 Azure 日志中有以下日志:

在此处输入图像描述

The query for the above is as follows:上述查询如下:

在此处输入图像描述

The output is shown below appearing like a 'scatter diagram' but I am looking for a timechart - like connecting the dots but failed to do so: output 如下所示,看起来像一个“散点图”,但我正在寻找一个时间表 - 就像连接点但没有这样做:

在此处输入图像描述

How do I join the dots or is there a limitation or the way the KQL above (Kusto Query Language) is written?如何加入这些点,或者上面的 KQL(Kusto 查询语言)的编写方式是否存在限制或方式?

It is your KQL query that has to be modified.必须修改的是您的 KQL 查询。 The key to getting your time-series charts right is to fetch all the time and metric information in the result set from your query.正确获取时间序列图表的关键是从查询中获取结果集中的所有时间和指标信息。

Remember that when constructing a timechart, the first column is the x-axis, and should be datetime.请记住,在构建时间表时,第一列是 x 轴,应该是日期时间。 Other (numeric) columns are y-axes.其他(数字)列是 y 轴。 There is one string column whose values are used to "group" the numeric columns and create different lines in the chart (further string columns are ignored).有一个字符串列,其值用于“分组”数字列并在图表中创建不同的线(忽略其他字符串列)。

Considering the requests table as an example (you can apply it to your customEvents data as appropriate), multiple metrics can be plotted as:requests表为例(您可以酌情将其应用于您的customEvents数据),可以将多个指标绘制为:

# Time-series chart with multiple metrics
requests
| summarize Requests = count(), Users = dcount(user_Id) by bin(timestamp, 1h)
| render timechart

Output: Output: 绘制多个指标

The query control uses timestamp for the X-axis and Requests & Users as separate series on the Y-axis here.查询控件在 X 轴上使用时间戳,在 Y 轴上使用请求和用户作为单独的系列。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何记录 kusto 查询以在一个时间图中可视化多个维度? - How to log kusto query to visualize multiple dimension in one timechart? Kusto 查询语言 - 如何准确获取前一天的日志 7 - Kusto query language - How to get exactly logs from previous day 7 Azure 监控日志(Kusto 查询语言)中列内的日期时间差 - Date time difference within a column in Azure Monitor Logs (Kusto Query Language) 仅获取 Kusto 查询语言(Azure Monitor 日志)中的类别中的唯一值 - Getting only unique values within a category in Kusto Query Language (Azure Monitor Logs) Azure Logs Kusto 查询输出到数据库表 - Azure Logs Kusto Query Output to database table 如何在 Kusto 时间表上缩放数据系列 - How to scale a data series on a Kusto timechart 如何在 Azure Log Analytics 时间表查询中重命名轴 - How to rename axes in Azure Log Analytics Timechart Query 如何使用 Kusto 修改自定义日志 - How to modify custom logs using Kusto 如何使用 Azure Kusto 查询语言 (KQL) 查询 Jmeter Graph,例如 Active Threads Over times - How to use Azure Kusto Query Language (KQL) to query Jmeter Graph such as Active Threads Over times 如何从Powershell查询Azure AppInsights自定义指标 - How to query Azure AppInsights custom metric from Powershell
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM