你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzWindowsEventLogDataSourceObject
为 WindowsEventLogDataSource 创建内存中对象。
语法
New-AzWindowsEventLogDataSourceObject
[-Name <String>]
[-Stream <String[]>]
[-XPathQuery <String[]>]
[<CommonParameters>]
说明
为 WindowsEventLogDataSource 创建内存中对象。
示例
示例 1:创建 Windows 事件日志数据源对象
New-AzWindowsEventLogDataSourceObject -Name cloudSecurityTeamEvents -Stream Microsoft-WindowsEvent -XPathQuery "Security!"
Name Stream XPathQuery
---- ------ ----------
cloudSecurityTeamEvents {Microsoft-WindowsEvent} {Security!}
此命令使用 XPathQuery 创建 Windows 事件日志数据源对象。
示例 2:创建 Windows 事件日志数据源对象
New-AzWindowsEventLogDataSourceObject -Name appTeam1AppEvents -Stream Microsoft-WindowsEvent -XPathQuery "System![System[(Level = 1 or Level = 2 or Level = 3)]]","Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]"
Name Stream XPathQuery
---- ------ ----------
appTeam1AppEvents {Microsoft-WindowsEvent} {System![System[(Level = 1 or Level = 2 or Level = 3)]], Application!*[System[(Level = 1 or Level = 2 or Level = 3)]]}
此命令使用 XPathQueries 创建 Windows 事件日志数据源对象。
参数
-Name
数据源的友好名称。 此名称应在数据收集规则中的所有数据源(无论类型)中是唯一的。
类型: | String |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-Stream
此数据源将发送到的流列表。 流指示将用于此数据的架构,以及 Log Analytics 中要发送到的数据的表。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |
-XPathQuery
XPATH 格式的 Windows 事件日志查询列表。
类型: | String[] |
Position: | Named |
默认值: | None |
必需: | False |
接受管道输入: | False |
接受通配符: | False |