符合 regex 運算符

適用於:✅Microsoft網狀架構Azure 數據✅總管 Azure 監視器✅Microsoft Sentinel

根據區分大小寫 的正則表達式 值篩選記錄集。

如需其他運算符的詳細資訊,以及判斷哪一個運算元最適合您的查詢,請參閱 數據類型字串運算元

注意

效能取決於搜尋類型和數據結構。 如需最佳做法,請參閱 查詢最佳做法

語法

T where | col 表示式 matches regex ()

深入瞭解 語法慣例

參數

姓名 類型​​ 必要 描述
T string ✔️ 要篩選其記錄的表格式輸入。
col string ✔️ 要篩選的數據行。
expression 純量 ✔️ 用來篩選的正則表示式 regex.md。 regex 群組的最大數目為 16。 如需 Kusto 所支援之 regex 語法的詳細資訊,請參閱 正則表達式

傳回

述詞為 true的 T 數據列。

範例

StormEvents
| summarize event_count=count() by State
| where State matches regex "K.*S"
| where event_count > 10
| project State, event_count

輸出

州/省 event_count
堪薩斯州 3166
阿肯色州 1028
蘇必利爾湖 34
LAKE ST CLAIR 32