SPL基礎文法

SPL基礎文法

SPL語句

-- SPL處理結果定義為命名資料集src,作為後續SPL運算式的輸入

.let src = *

| where status=cast(status as BIGINT);

-- 以命名資料集src作為輸入,篩選status欄位為5xx的資料,定義資料集err,不輸出

.let err = $src

| where status >= 500

| extend msg='ERR';

-- 以命名資料集src作為輸入,篩選status欄位為2xx的資料,定義資料集ok,不輸出

.let ok = $src

| where status >= 200 and status < 300

| extend msg='OK';

-- 輸出命名資料集err和ok

$err;

$ok;輸入資料

# 條目1

status: '200'

body: 'this is a test'

# 條目2

status: '500'

body: 'internal error'

# 條目3

status: '404'

body: 'not found'輸出結果

# 條目1: 資料集為err

status: '500'

body: 'internal error'

msg: 'ERR'

# 條目2: 資料集為ok

status: '200'

body: 'this is a test'

msg: 'OK'

相关推荐

哪些餐具可以放在微波炉里加热
棋牌365大厅

哪些餐具可以放在微波炉里加热

📅 11-30 👁️ 8559
咸鸭蛋煮多久不会破?
microsoft 365下载

咸鸭蛋煮多久不会破?

📅 01-03 👁️ 2679
微博如何删除分组:轻松管理你的社交圈子
棋牌365大厅

微博如何删除分组:轻松管理你的社交圈子

📅 09-20 👁️ 9602
凯南皮肤哪个手感好:玩家亲测解析
日博365投注

凯南皮肤哪个手感好:玩家亲测解析

📅 01-24 👁️ 6621