将定制量分为3个JSON,然后使用Kusto查询进行项目
因此,我有一个kusto查询,
requests
| where customDimensions has'Scope' and customDimensions['Scope'] != 'Unauthenticated' and cloud_RoleName == 'cloud1'
| project x = tostring(customDimensions['x'], y = tostring(customDimensions['y'] ...
我希望将我的codedimensions
值分为3个JSON。 然后将其投影,
| project json1 = json1, json2 = json2, json3 = json3
但我无法分组/拆分我尝试过的动态的定制量,但它们不将变量作为输入 对于Eg dynamic_to_json(dynamic({'x':customDimensions ['x']})))
对数据表错误的错误抛出了
上述语句给出的错误应该以'结尾的错误。 }'
显然我的语法是正确的。我觉得它某种程度上无法访问动态或数据表中的定制变量,
任何人都可以指导我。.
我希望输出,因为
| json1 | json2 | json3 |
|{...} | {...} | {...} |
所有3个JSON都将从同一表的自定义限制或其他列创建;
假设定制中有任何事情
customDimensions = {x:X, y:Y, a:A, ...}
json1 should have {x, y z}
json2 should have {r, t, p,}
json3 should have {w, m, n}
So, I have a Kusto query
requests
| where customDimensions has'Scope' and customDimensions['Scope'] != 'Unauthenticated' and cloud_RoleName == 'cloud1'
| project x = tostring(customDimensions['x'], y = tostring(customDimensions['y'] ...
i want the split my customDimensions
values into 3 jsons.
then project it as
| project json1 = json1, json2 = json2, json3 = json3
but i not able to group/split the customDimensions i tried dynamic, datatable but they dont take variables as inputs
for e.g dynamic_to_json(dynamic({'x': customDimensions['x'] }))
throws an error same for the data tables
Error that the above statement gives is it should end with '}'
where clearly my syntax is correct. i feel it somehow does not accesses the customDimensions variable inside dynamic or datatable
could anyone please guide me on this..
I want the output as
| json1 | json2 | json3 |
|{...} | {...} | {...} |
all the 3 json's will be created from customDimensions or other columns of the same table;
about customDimensions https://camerondwyer.com/2020/05/26/how-to-use-application-insights-custom-properties-in-azure-monitor-log-kusto-queries/
assume there is any thing in customDimensions like
customDimensions = {x:X, y:Y, a:A, ...}
json1 should have {x, y z}
json2 should have {r, t, p,}
json3 should have {w, m, n}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在与@Sandeep Ranjan进行了对话之后:
这里的挑战是从存储为动态的JSON文档中提取字段,然后将它们包装到3个新的JSON文档中。
提取字段很简单,e,g。:
或
以后的字段名称具有空格和/或特殊字符的字段名称,例如:
包装字段可以使用3种不同的函数来完成彼此的同义词。
这些功能是 pack()& bag_pack(
) :
小提琴
Following a conversation with @Sandeep Ranjan:
The challenge here was to extract fields from a JSON document stored as dynamic and then pack them together to 3 new separate JSON documents.
Extracting fields is straightforward, E,g.:
or
The later can be used for fields names with spaces and/or special characters, E.g.:
Packing the fields can be done with 3 different functions that are synonyms to each other.
Those functions are pack_dictionary(), pack() & bag_pack()
Here is a quick sample:
Fiddle