繁体   English   中英

排除KQL SLA图表中的数据

[英]Excluding data in KQL SLA charts

我们正在显示URL,VPN和VM的SLA图表,如果有任何计划的定期维护,我们希望将KQL SLA图表中的时间排除在已知停机时间之外。

在这段时间中,我们将通过下面的列传递给Loganalytics定制表,从而通过Powershell禁用警报。

     "resourcename": "$resourcename",
     "Alertstate": "Enabled",
     "Scheduledmaintenance" : "stop",
     "Environment" : "UAT",
     "timestamp": "$TimeStampField",

    Now we want to use join condition SLA charts queries  with custom table data and exclude the time range in SLA charts during scheduled maintenance.

    Adding query as per request
    ---------------------------

    url_json_CL
    | where Uri_s contains "xxxx"
    | extend Availablity = iff(StatusCode_d ==200,1.000,0.000)
    | extend urlhit = 1.000
    | summarize PassCount = sum(Availablity), TestCount = sum(urlhit) by Uri_s ,ClientName_s
    | extend AVLPERCENTAGE = ((PassCount / TestCount ) * 100)
    | join kind=leftouter 
(  scheduledmaintenance2_CL
     | where ResourceName_s == "VMname" 
     | where ScheduledMaintenance_s == "start" 
     | extend starttime = timestamp_t)
     on ClientName_s
    | join kind= leftouter
     (scheduledmaintenance2_CL
     | where ResourceName_s == "VMname" 
     | where ScheduledMaintenance_s == "stop" 
     | extend stoptime = timestamp_t )
     on ClientName_s
     | extend excludedtime=stoptime - starttime  
     | project ClientName_s, ResourceName_s, excludedtime, AVLPERCENTAGE , Uri_s 
     | top 3 by  ClientName_s  desc

您可以在Azure Monitor中执行跨资源日志查询

  1. 使用Application Insights资源管理器,我们还可以查询Log Analytics工作区自定义表。

workspace("/subscriptions/xxxxxx-xxxx-xxxx-xxxx-xxxxxxxxx/resourcegroups/rgname/providers/Microsoft.OperationalInsights/workspaces/workspacename").Event | count

  1. 使用Log Analytics日志浏览器可以查询Application Insights可用性结果

app("applicationinsightsinstancename").availabilityResults

您可以使用上述任何选项来查询所需的表并联接这些表。 请参考文档的连接。

其他文档参考

希望这可以帮助。

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM