简体   繁体   English

如何在 LogicApps 中使用 KQL 查询构建嵌套的 HTML 表?

[英]How to build up a nested HTML Table using a KQL query in LogicApps?

I'm facing an issue with slow performance in this post: Slow performing triple Foreach with Parallelism taking up 40 minutes with LogicApps?我在这篇文章中遇到了性能缓慢的问题: 使用 LogicApps 并行执行三重 Foreach 占用 40 分钟? , hence thinking of building the solution in a KQL query. ,因此考虑在 KQL 查询中构建解决方案。

Situation: I have a Foreach Category within a Foreach of Products with a run time of 40 minutes.情况:我在 Foreach 产品中有一个 Foreach 类别,运行时间为 40 分钟。 Basically it builds an HTML table for each Category, and within that category it places the Products together with the right Specialization.基本上,它为每个类别构建一个 HTML 表,并在该类别中将产品与正确的专业化放在一起。

Current setup:当前设置:

  • Foreach Category contains 5 items Foreach 类别包含 5 个项目
    • Foreach Products contains 300 items Foreach 产品包含 300 项
      • Foreach Specialization contains 5 items Foreach 专业化包含 5 个项目

The results are retrieved from Azure Log Analytics and stored in a LogicApp variable list which can be iterated.结果从 Azure Log Analytics 检索并存储在可迭代的 LogicApp 变量列表中。 How can I build the above solution in to a KQL query?如何将上述解决方案构建到 KQL 查询中?

If I understand the question correctly, you can solve it with one list containing the category, products and specialization, for example:如果我正确理解了这个问题,您可以使用一个包含类别、产品和专业化的列表来解决它,例如:

datatable(Product:string, Category:string, Specialization:string)
[
"p1", "c1", "s1",
"p1", "c2", "s1", 
"p1", "c2", "s2", 
"p1", "c1", "s1",
"p2", "c2", "s1", 
"p2", "c2", "s2"
]
| summarize by Product, Category, Specialization
| order by Product asc, Category asc, Specialization asc 

If the products, categories and specializations are in different tables use the " lookup " operator to join them together and then do the summarization followed by sort.如果产品、类别和专业位于不同的表中,请使用“ 查找”运算符将它们连接在一起,然后进行汇总和排序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM