我正在尝试将 json 文件摄取到 kusto(.zip 文件)中,并使用更新策略进一步处理 json
Approach 1 :file has following contents
{
"id": "id0",
"logs": [
{
"timestamp": "2021-05-26T11:33:26.182Z",
"message": "test message 1"
},
{
"timestamp": "2021-05-26T11:33:26.182Z",
"message": "test message 1"
}
]
}
.create table test (
logs : dynamic
)
.create-or-alter table test ingestion json mapping 'testmapping'
'['
'{"column":"logs","path":"$.logs","datatype":"","transform":"None"}'
']'
.ingest into table test(
h@"sasUrlfromazureBlob"
)
with (
format = "multijson",
ingestionMappingReference = "testmapping",
zipPattern = "*"
)
以上是在一行中摄取整个日志数组,但我希望将其扩展为多行
方法2:
Input file conatains:
[
{
"timestamp": "2021-05-26T11:33:26.182Z",
"message": "test message 1"
},
{
"timestamp": "2021-05-26T11:33:26.182Z",
"message": "test message 1"
}
]
.create table test (
logs : dynamic
)
.create-or-alter table test ingestion json mapping 'testmapping'
'['
'{"column":"logs","path":"$","datatype":"","transform":"None"}'
']'
上面很好地将日志扩展到多行(本例中为 2 行)但是当我从对象(Approach1)中选择数组时,它会转储到单行中,问题是,动态数据类型的数据限制为 1MB