如何在使用 az monitor app-insights 查询时 运行 进行多行查询?
How can I run a multi-line query while using az monitor app-insights query?
如何在使用 az monitor app-insights query
时 运行 进行多行查询?
此单行查询按预期工作:
$query = "requests | summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
此多行查询导致错误:
$query = @"
requests |
summarize count() by bin(timestamp, 1h)
"@
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
这行得通,但我宁愿使用此处的字符串:
$query =
"requests | " +
"summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
如何在使用 az monitor app-insights query
时 运行 进行多行查询?
此单行查询按预期工作:
$query = "requests | summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
此多行查询导致错误:
$query = @"
requests |
summarize count() by bin(timestamp, 1h)
"@
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m
这行得通,但我宁愿使用此处的字符串:
$query =
"requests | " +
"summarize count() by bin(timestamp, 1h)"
az monitor app-insights query --app $appId --analytics-query $query --offset 1h30m