【问题标题】:Kusto/LogAnalytics data to pie chartKusto/LogAnalytics 数据到饼图
【发布时间】:2020-07-10 13:11:08
【问题描述】:

谁能给我一个示例代码,我如何在饼图中呈现这些数据?

我想要计算每个类别中是否是最新的计算机。 我也在这里得到重复的“计算机”条目,因为它们在不同的日期有几个条目,我只想要最后一个状态。

Example data - Image

【问题讨论】:

    标签: azure azure-log-analytics azure-data-explorer azure-monitoring azure-monitor-workbooks


    【解决方案1】:

    这里有一个类别的选项(用 summarize 的键替换其他类别的组):

    datatable(computer:string, featureUpdateStatus:string, qualityUpdateStatus:string, securityUpdateStatus:string, lastScan:datetime)
    [
        "c1", "not up-to-date", "up-to-date", "up-to-date", datetime(2020-07-07 14:03:50),
        "c1", "not up-to-date", "up-to-date", "up-to-date", datetime(2020-07-07 15:02:59),
        "c2", "not up-to-date", "up-to-date", "up-to-date", datetime(2020-07-06 11:44:40),
        "c2", "not up-to-date", "up-to-date", "up-to-date", datetime(2020-07-07 16:18:01),
        "c3", "up-to-date",     "up-to-date", "up-to-date", datetime(2020-07-07 13:39:09),
        "c3", "up-to-date",     "up-to-date", "up-to-date", datetime(2020-07-07 12:26:45),
        "c4", "not up-to-date", "up-to-date", "up-to-date", datetime(2020-07-07 16:18:01),
        "c4", "up-to-date",     "up-to-date", "up-to-date", datetime(2020-07-07 13:39:09),
    ]
    | summarize arg_max(lastScan, *) by computer
    | summarize count() by featureUpdateStatus
    | render piechart
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2013-06-15
      • 2014-04-27
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多