简体   繁体   English

如何获取 IIS 启动日志以获取相应 IIS 停止日志中的 Azure Log Analytics 在警报的监视时间段之外

[英]How to fetch IIS Start log for a corresponding IIS Stop log in Azure Log Analytics outside of Alert's monitoring time period

I'm working on configuring an Azure Log Analytics alert (using KQL) to capture the IIS Stop & Start events (from Events table) in my OMS Workspace, and if the alert query finds that there's no corresponding IIS Start event log generated from a PaaS Role for a particular IIS Stop event log- the user should get notified by an alert so that he can bring IIS back up.我正在配置一个 Azure Log Analytics 警报(使用 KQL)以在我的 OMS 工作区中捕获 IIS 停止和启动事件(来自Events表),并且如果警报查询发现没有相应的 Z5DA5ACFEC 事件从日志 601B4EFB27E65 生成特定 IIS 停止事件日志的 PaaS 角色 - 用户应收到警报通知,以便他可以恢复 IIS。

Problem: Let's say I setup my alert to run over a Time Period & Frequency of 15mins.问题:假设我将警报设置为在 15 分钟的时间段和频率上运行。 If the alert triggered at 10:30AM, that means it will scan the IIS logs from 10:15:01 AM to 10:29:59 AM.如果警报在上午 10:30 触发,这意味着它将从上午 10:15:01 到上午 10:29:59 扫描 IIS 日志。 Now, suppose an IIS Stop event got logged in around 10:28 AM, then the respective IIS Start log (if any) will be logged in after a couple of minutes around 10:31AM or 10:32 AM – and hence it will go out of the alert's monitoring time period. Now, suppose an IIS Stop event got logged in around 10:28 AM, then the respective IIS Start log (if any) will be logged in after a couple of minutes around 10:31AM or 10:32 AM – and hence it will go超出警报的监控时间段。 This will create a false positive failure scenario.这将创建误报失败场景。 (IIS got started back but my alert didn't captured the Start event log). (IIS 重新启动,但我的警报没有捕获启动事件日志)。 And thus, it might lead to some unnecessary IIS Start/Reset operations on my PaaS roles.因此,它可能会导致对我的 PaaS 角色进行一些不必要的 IIS 启动/重置操作。

Attaching a representative quick sketch to explain it figuratively.附上一张有代表性的速写,形象地解释一下。

IIS_Start_Stop_Events_issue

Please let me know if there's any possible approach to achieve this.请让我知道是否有任何可能的方法来实现这一目标。 Any suggestions are welcome.欢迎任何建议。 Thanks in advance!提前致谢!

Current implementation as follows.当前实现如下。

在此处输入图像描述

Here we can see False Alert generated at 10:30.在这里,我们可以看到在 10:30 生成的错误警报。

You can see the below approach, where we select last 10 minutes data(Overlapped) every 5 minutes.您可以看到下面的方法,我们 select 每 5 分钟最后 10 分钟数据(重叠)。

在此处输入图像描述

For the below case you can generate the alert对于以下情况,您可以生成警报

在此处输入图像描述

See if its helping you.看看它是否对你有帮助。

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

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