如何从具有不同模式的多个资源中提取数据

How to ingest data from multiple resources with different schema

我需要集中来自具有不同架构的多个资源的日志

例如

source1 中的架构:时间戳、错误代码、错误描述

source2 中的架构:时间戳、eventId、事件描述

Table 被创建为

.create table TraceLog (Timestamp:datetime, errorcode:string, errordescription:string, eventId:string, eventdescription:string)

为了从 source1 中提取数据,我可以简单使用

.ingest inline into Table TraceLog <| 2020-05-01, "error code", "test error description"

对于来自 source2 的数据,

除外

.ingest inline into Table TraceLog <| 2020-05-01, "", "", "test event ID", "test event description"

在不指定 source1 中的列的情况下,还有其他方法可以摄取数据吗?

最简单的选择是使用每个不同来源的摄取映射:

https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/mappings

如果数据需要额外的转换(例如解析):您可以使用更新策略:

https://docs.microsoft.com/en-us/azure/data-explorer/kusto/management/updatepolicy