azure app insights从url获取字符串的一部分,并将其显示在名称列中
我正在使用azure app insights,我想从url解析字符串的一部分,并在名称列中显示该部分azure app insights从url获取字符串的一部分,并将其显示在名称列中,azure,azure-application-insights,Azure,Azure Application Insights,我正在使用azure app insights,我想从url解析字符串的一部分,并在名称列中显示该部分 requests | where user_AuthenticatedId != "" and url contains "reports" and user_AuthenticatedId == "xxx" | project timestamp, user_AuthenticatedId, client_CountryOrReg
requests
| where user_AuthenticatedId != ""
and url contains "reports" and user_AuthenticatedId == "xxx"
| project timestamp, user_AuthenticatedId, client_CountryOrRegion, client_OS, url,name
| order by timestamp asc nulls last
例如,我获取的url为https://localhost:80/api/external-reports/blob/39/test 01b/false,因此我想从中获取test 01b,并在name列中显示它
我不知道怎么做。有些功能可能会有所帮助 首先,您可以使用方法获取不同的url部分。例如,给定urlhttps://localhost:80/api/external-报告/blob/39/test 01b/false:
requests
| project parse_url(url)
输出:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 您可以使用以下方法进一步拆分结果:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 要获取所需零件,可以使用索引:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 当使用的索引大于部分数时,将返回空结果。您可以使用以下函数将其替换为自己的值:
当索引超出范围或零件为空时,它显示unknown。有些函数可能会有所帮助 首先,您可以使用方法获取不同的url部分。例如,给定urlhttps://localhost:80/api/external-报告/blob/39/test 01b/false:
requests
| project parse_url(url)
输出:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 您可以使用以下方法进一步拆分结果:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 要获取所需零件,可以使用索引:
{"Scheme":"https","Host":"localhost","Port":"80","Path":"/api/external-reports/blob/39/test 01b/false","Username":"","Password":"","Query Parameters":{},"Fragment":""}
["","api","external-reports","blob","39","test 01b","false"]
test 01b
- 当使用的索引大于部分数时,将返回空结果。您可以使用以下函数将其替换为自己的值:
当索引超出范围或零件为空时,它显示unknown。非常感谢。这就是我要找的。非常感谢。这就是我要找的。