![](/img/trans.png)
[英]Query and sort data from inside one of tables (Azure Log Analytics)
[英]Query multiple tables in Azure Log Analytics
我正在查看 web 應用程序的 Azure 日志分析,並且我有多個包含數據的開箱即用“表”: traces
、 requests
、 exceptions
等。
我可以構造一個對來自多個表的數據運行的查詢嗎? 我不想加入來自不同來源的數據,我只想連接/交錯它,所以我可以查找例如“所有包含字符串'SQL'的跟蹤和異常”。
理論上,類似:
traces, exceptions
| where * contains "SQL"
| order by timestamp desc
| limit 100
這可能嗎?
你可以使用union
。 我發現非常有用的是將所有表與union *
起來。 例如:
union *
| where * contains "SQL"
這樣,您將在所有表中搜索包含 SQL 的任何列
如果您想要特定的表(例如traces
和exceptions
):
traces
| union exceptions
| where * contains "SQL"
您可能還需要考慮search
運算符
search in (exceptions, traces) "SQL"
| order by timestamp desc
| take 100
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.