簡體   English   中英

查詢 Azure Log Analytics 中的多個表

[英]Query multiple tables in Azure Log Analytics

我正在查看 web 應用程序的 Azure 日志分析,並且我有多個包含數據的開箱即用“表”: tracesrequestsexceptions等。

我可以構造一個對來自多個表的數據運行的查詢嗎? 我不想加入來自不同來源的數據,我只想連接/交錯它,所以我可以查找例如“所有包含字符串'SQL'的跟蹤異常”。

理論上,類似:

traces, exceptions
| where * contains "SQL"
| order by timestamp desc
| limit 100

這可能嗎?

你可以使用union 我發現非常有用的是將所有表與union *起來。 例如:

union *
| where * contains "SQL"

這樣,您將在所有表中搜索包含 SQL 的任何列

如果您想要特定的表(例如tracesexceptions ):

traces 
| union exceptions
| where * contains "SQL"

您可能還需要考慮search運算符

search in (exceptions, traces) "SQL"
| order by timestamp desc 
| take 100

https://docs.microsoft.com/en-us/azure/data-explorer/kusto/query/searchoperator?pivots=azuredataexplorer

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM