[英]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
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.