azure-data-explorer - KQL / Azure Resource Graph Explorer:组合来自多条记录的值
问题描述
我正在尝试获取为 azure 资源图资源管理器中的一组负载均衡器配置的所有公共 ips 和 fqdns。我通过以下查询获得了我需要的所有数据:
Resources
| where type =~ 'Microsoft.Network/loadBalancers'
| where subscriptionId =~ '11111111-2222-3333-4444-555555555555'
| where resourceGroup =~ 'resource-group-name'
| mv-expand ipConfig=properties.frontendIPConfigurations
| project name, publicIpId = tostring(ipConfig.properties.publicIPAddress.id)
| join kind=leftouter (
Resources
| where type =~ 'microsoft.network/publicipaddresses'
| project publicIpId = id, publicIpAddress = tostring(properties.ipAddress), fqdn = tostring(properties.dnsSettings.fqdn)
)
on publicIpId
| summarize by name, publicIpAddress, fqdn
但结果的形式是:
name publicIpAddress fqdn
outbound-lb x.y.z.1 a domain
frontend-lb x.y.z.2 another domain
frontend-lb x.y.z.3 third domain
services-lb x.y.z.4 fourth domain
我需要的是:
name publicIpAddress fqdn
outbound-lb x.y.z.1 a domain
frontend-lb x.y.z.2, x.y.z.3 another domain, third domain
services-lb x.y.z.4 fourth domain
我一直在查看该summarize make_list()
功能,但未能成功获得所需的结果!
解决方案
你可以尝试替换这个:
| summarize by name, publicIpAddress, fqdn
有了这个:
| summarize publicIpAddress = strcat_array(make_set(publicIpAddress), ", "),
fqdn = strcat_array(make_set(fqdn), ", ")
by name
推荐阅读
- c# - 如何使用条件窗口而不是基于时间的窗口将整数流拆分为缓冲区?
- f# - 使用 F# 编译器服务解析计算表达式
- excel - 如何将 PDF(同一工作簿中不同 Excel 工作表中的位置)附加到 Outlook 邮件?
- python - Windows 和 Linux 的 PIL 库是否不同?PIL 图像过滤器不适用于 Rasp Pi
- c# - Unity中Json解析的异常问题
- python - 我试图以 100hz 采样,而不是像程序运行一样快。我该怎么做?
- django - 如何从 Django 模型表单中的 POST 请求中提取单个值?
- python - 如何根据时间不在列表中的时间戳删除行
- cron - Cron schedule to run at 11:55, 12:00 and 12:05
- angular - 在Angular 6中只允许只有一位小数的正数