只要你有一件合理的事去做,你的生活就会显得特别美好! ------ 博客首页

Azure Sentinel 配置管理系列(PART3)

Azure Sentinel 监控Linux Syslog

首先从Azure Portal中创建一个Linux虚拟机(以Red Hat为例):

安装 Syslog

Azure Portal 中搜索 Azure Sentinel,点击之前创好的 Log Analytics 的workspace,左侧选择 Data connectors:

标题: fig:

搜索 Syslog:

标题: fig:

安装Syslog:

标题: fig:

监控Linux虚拟机

选择需要监控的Linux虚拟机并connect:

标题: fig:

实际上,是在Linux虚拟机中安装了omsagent:

标题: fig:

该日志文件路径为 /var/log/waagent.log:

标题: fig:

选择需要监控的日志

Portal中回到 Log Analytics Workspace 界面,找到之前创建的workspace点击左侧 Advanced Settings:

标题: fig:

点击 Data -> Syslog,选择需要监控的日志:

标题: fig:

勾选 Apply below configuration to my machines,搜索 auth 并选中,再点击右边 + 号:

标题: fig:

再添加 daemon, syslog, user, 然后点击上方 Save:

标题: fig:

保存成功后,点击上方 Logs:

标题: fig:

标题: fig:

查询 Syslog 日志

在框内输入查询语句:

标题: fig:

# 查询语句如下

<P>let Now = now();
<P>(range TimeGenerated from ago(7d) to Now-1d step 1d
<P>| extend Count = 0
<P>| union isfuzzy = true (Syslog
<P>| summarize Count = count() by bin_at(TimeGenerated, 1d, Now))
<P>| summarize Count = max(Count) by bin_at(TimeGenerated, 1d, Now)
<P>| sort by TimeGenerated
<P>| project Value = iff(isnull(Count), 0, Count), Time = TimeGenerated, Legend 
= "Syslog")
<P>| render timechart</P>

可以看到查询结果:

标题: fig:

在 Azure Sentinel -> Overview 中,也能看到多出了 Syslog的监控数据:

标题: fig:

参考资料

posted on 2025-03-29 22:14  --Dongjie  阅读(18)  评论(0)    收藏  举报