代码之家  ›  专栏  ›  技术社区  ›  Dave New

与“in”条件一起使用的表格类型

  •  0
  • Dave New  · 技术社区  · 7 年前

    in 条件语句?请参见下面第二个查询中的最后一个条件: Computer in clusterNodes . 我发现以下语法错误:

    令牌:行中:9位置:181

    let clusterNodes = 
    KubeNodeInventory
    | where TimeGenerated > ago(7d)
    | where ClusterName == "test-aks"
    | distinct Computer;
    
    Perf
    | where TimeGenerated > ago(1d) 
    | where CounterName == "cpuUsageNanoCores" and ObjectName == "K8SNode" and Computer in clusterNodes 
    | summarize ValueAvg = avg(CounterValue) by Time = bin(TimeGenerated, 15m), Counter = CounterName
    | project round(ValueAvg / 1000000000, 2), Time, Counter 
    | render timechart;
    
    1 回复  |  直到 7 年前
        1
  •  0
  •   Dmitry Matveev    7 年前

    在里面 在这种情况下:

    | where … and Computer in (clusterNodes)
    

    另外,您可能还需要删除中间的空行 以及查询的其余部分(取决于您在UI中选择要执行的查询的方式)。