- The externaldata operator was created to enable users of Azure Data Explorer (AKA Kusto) based SaaS systems, such as Log Analytics and Application Insights, to work with external data located in Azure storage.
Retrieving data from web sites in an unsupported scenario.
Sometimes it works, and sometimes not (depends on what lies on the other side).
For your specific URL, it does not work.
- KQL中的特殊名称可以用方括号和单/双限定词来表示,例如
['date']
或["date"]
- 整个文档被写在一行中.
json
个就够了.不需要multijson
.
- The assumed schema is wrong (
title:string, date:string, notes:string, bunting:bool
).
The JSON has 3 keys in the 1st layer, one for each kingdom: "england-and-wales"
, "scotland"
& "northern-ireland"
.
- 虽然我们可以使用上面的键来读取JSON,但我更喜欢将其读取为
txt
或raw
,将其解析为JSON,然后分解它,如下面的查询所示.
externaldata(doc:string)
[h'https://<storage-account-name>.blob.core.windows.net/mycontainer/bank-holidays.json;<secret>']
with(format='txt')
| project parse_json(doc)
| mv-expand kind=array doc
| project kingdom = tostring(doc[0])
,division = doc[1].division
,events = doc[1].events
| mv-expand events
| evaluate bag_unpack(events)
//| sample 10
kingfom |
division |
bunting |
date |
notes |
title |
northern-ireland |
northern-ireland |
false |
2017-04-14T00:00:00Z |
|
Good Friday |
england-and-wales |
england-and-wales |
true |
2017-05-29T00:00:00Z |
|
Spring bank holiday |
scotland |
scotland |
false |
2018-03-30T00:00:00Z |
|
Good Friday |
england-and-wales |
england-and-wales |
true |
2018-12-25T00:00:00Z |
|
Christmas Day |
northern-ireland |
northern-ireland |
false |
2019-04-19T00:00:00Z |
|
Good Friday |
england-and-wales |
england-and-wales |
true |
2019-12-25T00:00:00Z |
|
Christmas Day |
northern-ireland |
northern-ireland |
true |
2020-01-01T00:00:00Z |
|
New Year’s Day |
scotland |
scotland |
true |
2022-01-04T00:00:00Z |
Substitute day |
2nd January |
scotland |
scotland |
false |
2022-09-19T00:00:00Z |
|
Bank Holiday for the State Funeral of Queen Elizabeth II |
scotland |
scotland |
true |
2023-01-02T00:00:00Z |
Substitute day |
New Year’s Day |