シナリオ | SQL文 | SPLステートメント |
データフィルタリング | select * where Type='write'
| | where Type='write'
|
フィールド処理とフィルタリング | 正確モードでフィールドを検索し、フィールドの名前を変更します。 select "__tag __: node" as node, path
| 正確モードでフィールドを検索し、フィールドの名前を変更します。 | project node="__tag __: node", path
モードでフィールドを検索します。 | project -wildcard "__tag __: *"
他のフィールドに影響を与えずにフィールドの名前を変更します。 | project-rename node="__tag __: node"
モードでフィールドを削除します。 | project-away -ワイルドカード "__tag __: *"
|
データの標準化 (SQL関数呼び出し) | データ型と解析時間を変換します。 select
cast(Status as BIGINT) as Status,
date_parse(Time, '%Y-%m-%d %H:%i') AS Time
| データ型と解析時間を変換します。 | extend Status=cast(Status as BIGINT), extend Time=date_parse(Time, '% Y-% m-% d % H:% i')
|
フィールド抽出 | 正規表現ベースの抽出 select
regexp_extract(protocol, '\w+') as scheme,
regexp_extract(protocol, '\d+') as version
JSONデータ抽出 select
json_extract(content, '$.0.time') as time,
json_extract(content, '$.0.msg') as msg
| 正規表現ベースの抽出: 1回限りのマッチング | parse-regexpプロトコル, '(\w +)/(\d +)' as scheme, version
JSONデータ抽出: 完全拡張 | parse-json -path='$.0' content
CSVデータ抽出 | parse-csv -delim='^_^' content as ip、time、host
|