我的 linux VM 安装了 Linux Azure 诊断扩展并配置为将系统日志消息推送到事件中心。
我可以在事件中心进程数据刀片上查看我的系统日志消息。现在我正在尝试将这些日志发送到 Azure 数据资源管理器,为此我执行了以下步骤
- 在 ADX 中创建一个集群。
- 创建了用于存储系统日志消息的 Database(
Syslog) 和 table( )。SyslogTable - 为系统日志表创建 JSON 映射,映射事件中心数据所包含的字段。
- 创建了将事件中心连接到 ADX 表的数据摄取连接。
一切都很好,没有任何错误,因为.show ingestion failures没有显示任何错误,但我无法看到 ADX 表的任何数据。
以下是示例配置。
以 Json 格式从事件中心查看的示例数据
{
"time": "2020-05-18T15:54:01.0000000Z",
"resourceId": "/subscriptions/xxxxx/resourceGroups/xxxx/providers/Microsoft.Compute/virtualMachines/vmname",
"properties": {
"ident": "systemd",
"Ignore": "syslog",
"Facility": "daemon",
"Severity": "info",
"EventTime": "2020-05-18T15:54:01.0000000",
"SendingHost": "localhost",
"Msg": "Removed slice User Slice of root.",
"hostname": "vmname",
"FluentdIngestTimestamp": "2020-05-18T15:54:01.0000000Z"
},
"category": "daemon",
"level": "info",
"operationName": "LinuxSyslogEvent",
"EventProcessedUtcTime": "2020-05-19T07:39:48.5220591Z",
"PartitionId": 0,
"EventEnqueuedUtcTime": "2020-05-18T15:54:05.4390000Z"
}
ADX 表架构
.create table SyslogTable (
eventTime: datetime,
resourceId: string,
properties: dynamic ,
category: string,
level: string,
operationName: string,
EventProcessedUtcTime: string,
PartitionId: int,
EventEnqueuedUtcTime: datetime
)
ADX Syslog 表映射
.create table SyslogTable ingestion json mapping "SyslogMapping"
'['
' {"column":"eventTime", "Properties": {"Path": "$.time"}},'
' {"column":"resourceId", "Properties": {"Path":"$.resourceId"}},'
' {"column":"properties", "Properties": {"Path":"$.properties"}},'
' {"column":"category", "Properties": {"Path":"$.category"}},'
' {"column":"level", "Properties": {"Path": "$.level"}},'
' {"column":"operationName", "Properties": {"Path": "$.operationName"}},'
' {"column":"EventProcessedUtcTime", "Properties": {"Path": "$.EventProcessedUtcTime"}},'
' {"column":"PartitionId", "Properties": {"Path": "$.PartitionId"}},'
' {"column":"EventEnqueuedUtcTime", "Properties": {"Path": "$.EventEnqueuedUtcTime"}}'
']'
数据连接设置
Table: SyslogTable
Column Mapping: SyslogMapping
Data Format: Multiline Json/Json # tried with both
那么我在这里缺少什么?