本文へスキップ
SOC Analyst Role
  • インデックスを読み込み中…

↑↓ 移動 · ↵ 開く · Esc 閉じる

ja

チートシート

Splunk SPL vs Sentinel KQLチートシート

同じSOCハントを両方の言語で書き、つまずきやすい変換の落とし穴を1つずつ添えました。テクニック、テーブル、演算子、Event IDで検索できます。

演算子の対応表

Splunk SPLSentinel KQL
index=… sourcetype=…TableName(例:SecurityEvent)
search / wherewhere
stats count by xsummarize count() by x
stats dc(x)summarize dcount(x)
stats values(x)summarize make_set(x)
eval new=…extend new = …
table a b cproject a, b, c
rename a AS bproject-rename b = a
sort - countorder by count_ desc
head 10take 10 / top 10 by …
dedup xdistinct x(または summarize arg_max)
timechart span=1h countsummarize count() by bin(TimeGenerated, 1h) | render timechart
earliest=-24hwhere TimeGenerated > ago(24h)
rex field=x "(?<y>…)"extend y = extract("…", 1, x)

ハントの比較

25件中25件のハント

1 人のユーザーのイベントを検索・フィルターする

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4625 user=jsmith
Sentinel KQL
SecurityEvent
| where EventID == 4625
| where TargetUserName =~ "jsmith"

SPL のフィールド値は既定で大文字・小文字を区別しませんが、KQL の == は区別します。大文字・小文字を制御できない場合は =~(または has)を使います。

検索を直近 24 時間に限定する

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4624 earliest=-24h@h latest=now
Sentinel KQL
SecurityEvent
| where TimeGenerated between (ago(24h) .. now())
| where EventID == 4624

Splunk は @h で時刻を丸められますが、ago(24h) は丸めません。区切りを揃える必要があるなら startofday() や bin() を使い、パフォーマンスのため常に最初に TimeGenerated でフィルターします。

ユーザーと送信元 IP ごとにイベントを数える

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4625
| stats count by user, src_ip
| sort - count
Sentinel KQL
SecurityEvent
| where EventID == 4625
| summarize Count = count() by TargetAccount, IpAddress
| sort by Count desc

stats ... by は summarize ... by に対応します。KQL で集計結果をきれいにソートしたい場合は、集計列に明示的な列名を付ける必要があります。

最も多い・最も少ないプロセス名

基本
Splunk SPL
index=sysmon EventCode=1
| top limit=10 Image

index=sysmon EventCode=1
| rare limit=10 Image
Sentinel KQL
DeviceProcessEvents
| summarize Count = count() by FileName
| top 10 by Count desc

DeviceProcessEvents
| summarize Count = count() by FileName
| top 10 by Count asc

SPL の top/rare はカウントしてパーセント列も追加してくれます。KQL の top はソートして N 行を取るだけなので、先に summarize する必要があります。

RDP ログオンのユーザーと送信元のユニークな組み合わせ

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4624 Logon_Type=10
| dedup user, src_ip
| table _time, user, src_ip, host
Sentinel KQL
SecurityEvent
| where EventID == 4624 and LogonType == 10
| distinct TargetAccount, IpAddress, Computer

dedup は最新のイベント全体を残しますが、distinct は指定した列だけを返します。dedup のように行全体を残すには summarize arg_max(TimeGenerated, *) by TargetAccount, IpAddress を使います。

出力列の名前変更と選択

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4624
| rename src_ip AS SourceIP, user AS Account
| table _time, Account, SourceIP, host
Sentinel KQL
SecurityEvent
| where EventID == 4624
| project TimeGenerated, Account = TargetAccount, SourceIP = IpAddress, Computer

KQL の project は名前変更と選択を 1 ステップで行います。他の列をすべて残したい場合は project-rename を使います。

新しいフィールドを計算する(エラーフラグ、URI の長さ)

基本
Splunk SPL
index=web sourcetype=access_combined
| eval is_error=if(status>=500, 1, 0), uri_len=len(uri)
| stats sum(is_error) AS errors avg(uri_len) AS avg_uri_len by clientip
Sentinel KQL
W3CIISLog
| extend IsError = iff(toint(scStatus) >= 500, 1, 0), UriLen = strlen(csUriStem)
| summarize Errors = sum(IsError), AvgUriLen = avg(UriLen) by cIP

eval は extend に、if() は iff() に対応します。W3CIISLog の scStatus 列は文字列なので、数値比較の前に toint() でキャストします。

1 時間ごとのログオン失敗をグラフにする

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4625 earliest=-24h
| timechart span=1h count AS failed_logons
Sentinel KQL
SecurityEvent
| where TimeGenerated > ago(24h) and EventID == 4625
| summarize FailedLogons = count() by bin(TimeGenerated, 1h)
| render timechart

timechart は空のバケットを 0 で埋めますが、summarize by bin() は単に省略します。ベースライン作成で欠損が重要な場合は、KQL で make-series を使います。

ログオンを特権アカウントのリストでエンリッチする

基本
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4624
| lookup privileged_accounts.csv user OUTPUT role
| where isnotnull(role)
| table _time, user, role, src_ip, host
Sentinel KQL
let PrivAccounts = _GetWatchlist('PrivilegedAccounts')
| project TargetUserName = tostring(SearchKey), Role = tostring(Role);
SecurityEvent
| where EventID == 4624
| join kind=inner PrivAccounts on TargetUserName
| project TimeGenerated, TargetUserName, Role, IpAddress, Computer

Splunk のルックアップファイルの代わりに Sentinel のウォッチリストを使います。KQL の既定の join は innerunique で、左側を黙って重複排除するため、kind=inner を明示的に指定することを忘れないでください。

送信元 IP ごとのログオン失敗(ブルートフォースまたはスプレー)

認証T1110
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4625 earliest=-1h
| stats count AS failures dc(user) AS distinct_users values(user) AS targeted by src_ip
| where failures > 20
| sort - failures
Sentinel KQL
SecurityEvent
| where TimeGenerated > ago(1h) and EventID == 4625
| summarize Failures = count(), DistinctUsers = dcount(TargetAccount), Targeted = make_set(TargetAccount, 20) by IpAddress
| where Failures > 20
| sort by Failures desc

dc()/values() は dcount()/make_set() に対応します。1 つの IP からのユニークユーザー数が多ければスプレー、少なければブルートフォースを示します。

ブルートフォースの後に成功したログオン

認証T1110.001
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security (EventCode=4625 OR EventCode=4624) earliest=-1h
| eval fail_time=if(EventCode=4625, _time, null()), success_time=if(EventCode=4624, _time, null())
| stats count(fail_time) AS failures min(fail_time) AS first_fail count(success_time) AS successes max(success_time) AS last_success by src_ip, user
| where failures >= 10 AND successes > 0 AND last_success > first_fail
| convert ctime(first_fail) ctime(last_success)
Sentinel KQL
let Failures = SecurityEvent
| where TimeGenerated > ago(1h) and EventID == 4625
| summarize FailCount = count(), FirstFail = min(TimeGenerated) by IpAddress, TargetAccount;
SecurityEvent
| where TimeGenerated > ago(1h) and EventID == 4624
| summarize LastSuccess = max(TimeGenerated) by IpAddress, TargetAccount
| join kind=inner Failures on IpAddress, TargetAccount
| where FailCount >= 10 and LastSuccess > FirstFail
| project IpAddress, TargetAccount, FailCount, FirstFail, LastSuccess

SPL では通常、条件付きの stats で 1 パスで解決しますが、KQL では 2 つの let セットを IP とアカウントで結合するほうが自然に読めます。

複数の国からのサインイン(あり得ない移動)

認証T1078.004
Splunk SPL
index=o365 sourcetype=o365:management:activity Workload=AzureActiveDirectory Operation=UserLoggedIn earliest=-24h
| iplocation ClientIP
| stats dc(Country) AS countries values(Country) AS country_list values(ClientIP) AS ips by UserId
| where countries > 1
Sentinel KQL
SigninLogs
| where TimeGenerated > ago(24h) and ResultType == "0"
| extend Country = tostring(LocationDetails.countryOrRegion)
| summarize Countries = dcount(Country), CountryList = make_set(Country), IPs = make_set(IPAddress), Apps = make_set(AppDisplayName) by UserPrincipalName
| where Countries > 1

Splunk は検索時に iplocation で位置情報を付与しますが、SigninLogs にはすでに LocationDetails が含まれています。ResultType は文字列なので、0 ではなく "0" と比較します。

アカウントロックアウトとその発生元(4740)

認証T1110
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4740
| stats count values(Caller_Computer_Name) AS caller_computers by user
| sort - count
Sentinel KQL
SecurityEvent
| where EventID == 4740
| summarize Lockouts = count(), CallerComputers = make_set(TargetDomainName) by TargetAccount
| sort by Lockouts desc

SecurityEvent では 4740 の Caller Computer Name が TargetDomainName 列に入ります。これはよく知られた癖で、クエリを移植するときによく引っかかります。

新しく作成されたユーザーアカウント(4720)

認証T1136.001
Splunk SPL
index=wineventlog sourcetype=WinEventLog:Security EventCode=4720
| table _time, host, src_user, user
| rename src_user AS created_by, user AS new_account
Sentinel KQL
SecurityEvent
| where EventID == 4720
| project TimeGenerated, Computer, CreatedBy = SubjectAccount, NewAccount = TargetAccount

Splunk の Windows アドオンは作成者と対象を src_user と user に正規化しますが、SecurityEvent は元の SubjectAccount/TargetAccount の区分を保持します。

エンコードされた PowerShell のコマンドライン

プロセスT1059.001
Splunk SPL
index=sysmon EventCode=1 (Image="*\\powershell.exe" OR Image="*\\pwsh.exe") (CommandLine="* -e *" OR CommandLine="* -ec *" OR CommandLine="*-enc*")
| table _time, host, User, ParentImage, CommandLine
Sentinel KQL
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| where FileName in~ ("powershell.exe", "pwsh.exe")
| where ProcessCommandLine matches regex @"(?i)\s-(e|ec|en\w*)\s"
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine

PowerShell は -EncodedCommand の任意の前方一致を受け付けるため、固定文字列より正規表現のほうが有効です。ペイロードは UTF-16LE の Base64 なので、デコードしたテキストには取り除かない限り null バイトが表示されます。

シェルやスクリプトホストを起動する Office アプリケーション

プロセスT1204.002
Splunk SPL
index=sysmon EventCode=1 (ParentImage="*\\winword.exe" OR ParentImage="*\\excel.exe" OR ParentImage="*\\powerpnt.exe" OR ParentImage="*\\outlook.exe") (Image="*\\cmd.exe" OR Image="*\\powershell.exe" OR Image="*\\wscript.exe" OR Image="*\\cscript.exe" OR Image="*\\mshta.exe" OR Image="*\\rundll32.exe")
| table _time, host, User, ParentImage, Image, CommandLine
Sentinel KQL
DeviceProcessEvents
| where InitiatingProcessFileName in~ ("winword.exe", "excel.exe", "powerpnt.exe", "outlook.exe")
| where FileName in~ ("cmd.exe", "powershell.exe", "pwsh.exe", "wscript.exe", "cscript.exe", "mshta.exe", "rundll32.exe", "regsvr32.exe")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, FileName, ProcessCommandLine

Sysmon はフルパスを出すため、SPL ではバックスラッシュをエスケープしたワイルドカードが必要です。一方 MDE は素の FileName の値を分けて持つので、大文字・小文字を区別しない in~ のリストが適しています。

まれな親子プロセスの組み合わせ

プロセスT1059
Splunk SPL
index=sysmon EventCode=1 earliest=-7d
| eval parent=lower(mvindex(split(ParentImage, "\\"), -1)), child=lower(mvindex(split(Image, "\\"), -1))
| stats count dc(host) AS hosts values(host) AS host_list by parent, child
| where count < 5
| sort count
Sentinel KQL
DeviceProcessEvents
| where TimeGenerated > ago(7d)
| summarize Count = count(), Hosts = dcount(DeviceName), HostList = make_set(DeviceName, 10) by Parent = tolower(InitiatingProcessFileName), Child = tolower(FileName)
| where Count < 5
| sort by Count asc

SPL では split/mvindex でパスからファイル名を切り出す必要があります。KQL では summarize ... by の中でグループ化キーをインラインで計算できます。

ファイルのダウンロードやデコードに使われる certutil(LOLBin)

プロセスT1105
Splunk SPL
index=sysmon EventCode=1 (Image="*\\certutil.exe" OR OriginalFileName="CertUtil.exe") (CommandLine="*urlcache*" OR CommandLine="*verifyctl*" OR CommandLine="*-decode*")
| table _time, host, User, ParentImage, CommandLine
Sentinel KQL
DeviceProcessEvents
| where FileName =~ "certutil.exe" or ProcessVersionInfoOriginalFileName =~ "CertUtil.exe"
| where ProcessCommandLine has_any ("urlcache", "verifyctl", "decode")
| project TimeGenerated, DeviceName, AccountName, InitiatingProcessFileName, ProcessCommandLine

元のファイル名で照合すれば名前を変えたコピーも捕捉できます。KQL の has_any は単語全体で照合し、大きなテーブルでは contains よりはるかに高速です。

まれな宛先ポートへのアウトバウンド接続

ネットワークT1571
Splunk SPL
index=sysmon EventCode=3 Initiated=true NOT DestinationPort IN (80, 443, 53, 22, 25, 88, 123, 389, 445, 3389)
| where NOT (cidrmatch("10.0.0.0/8", DestinationIp) OR cidrmatch("172.16.0.0/12", DestinationIp) OR cidrmatch("192.168.0.0/16", DestinationIp))
| stats count dc(host) AS hosts values(Image) AS processes by DestinationPort
| where hosts < 3
| sort count
Sentinel KQL
DeviceNetworkEvents
| where TimeGenerated > ago(7d)
| where ActionType == "ConnectionSuccess" and RemoteIPType == "Public"
| where RemotePort !in (80, 443, 53, 22, 25, 88, 123, 389, 445, 3389)
| summarize Count = count(), Hosts = dcount(DeviceName), Processes = make_set(InitiatingProcessFileName, 10) by RemotePort
| where Hosts < 3
| sort by Count asc

Splunk ではプライベートアドレス範囲を除外するのに cidrmatch() が必要ですが、MDE は RemoteIPType でアドレスを事前に分類しています。NOT x IN (...) は !in になります。

長い DNS クエリ(DNS トンネリングの可能性)

ネットワークT1071.004
Splunk SPL
index=sysmon EventCode=22
| eval qlen=len(QueryName)
| where qlen > 60
| rex field=QueryName "(?<domain>[^.]+\.[^.]+)$"
| stats dc(QueryName) AS unique_queries max(qlen) AS max_len values(Image) AS processes by domain, host
| where unique_queries > 50
| sort - unique_queries
Sentinel KQL
DnsEvents
| where TimeGenerated > ago(24h) and SubType == "LookupQuery"
| where strlen(Name) > 60
| extend Domain = extract(@"([^.]+\.[^.]+)$", 1, Name)
| summarize UniqueQueries = dcount(Name), MaxLen = max(strlen(Name)), Clients = make_set(ClientIP, 10) by Domain
| where UniqueQueries > 50
| sort by UniqueQueries desc

rex は extract() に対応します。末尾 2 ラベルを取る単純な正規表現は co.uk のようなドメインを誤ってグループ化するため、結果は手がかりとして扱い、親ドメインごとのユニークなサブドメイン数を確認します。

多数の受信者に送る 1 つの外部送信者

メールT1566
Splunk SPL
index=mail sourcetype=ms:o365:reporting:messagetrace earliest=-24h NOT SenderAddress="*@corp.example.com"
| stats dc(RecipientAddress) AS recipients values(Subject) AS subjects values(Status) AS statuses by SenderAddress, FromIP
| where recipients > 20
| sort - recipients
Sentinel KQL
EmailEvents
| where TimeGenerated > ago(24h) and EmailDirection == "Inbound"
| summarize Recipients = dcount(RecipientEmailAddress), Subjects = make_set(Subject, 5), Actions = make_set(DeliveryAction) by SenderFromAddress, SenderIPv4
| where Recipients > 20
| sort by Recipients desc

EmailEvents では EmailDirection と DeliveryAction を直接使えます。一方 Splunk のメッセージトレースのデータでは、自社ドメインを除外し、配信の Status を自分で読み取る必要があります。

認証に失敗したのに配信された請求書・支払い関連のメール

メールT1566.001
Splunk SPL
index=mail sourcetype=ms:o365:reporting:messagetrace Status=Delivered (Subject="*invoice*" OR Subject="*payment*" OR Subject="*wire transfer*")
| table _time, SenderAddress, FromIP, RecipientAddress, Subject
Sentinel KQL
EmailEvents
| where TimeGenerated > ago(7d) and EmailDirection == "Inbound" and DeliveryAction == "Delivered"
| where Subject has_any ("invoice", "payment", "wire transfer")
| extend Auth = parse_json(AuthenticationDetails)
| where tostring(Auth.DMARC) =~ "fail" or tostring(Auth.SPF) =~ "fail"
| project TimeGenerated, SenderFromAddress, SenderIPv4, RecipientEmailAddress, Subject, AuthenticationDetails

メッセージトレースには SPF/DKIM/DMARC の判定がないため、Splunk ではゲートウェイやヘッダーのログにピボットします。一方 EmailEvents は AuthenticationDetails に JSON として公開しています。

Web サーバーログ内の SQL インジェクションのパターン

WebT1190
Splunk SPL
index=web sourcetype=access_combined
| eval decoded=urldecode(uri)
| where match(decoded, "(?i)(union\s+(all\s+)?select|or\s+1=1|sleep\(|benchmark\(|information_schema|' or ')")
| stats count values(status) AS statuses values(uri_path) AS paths by clientip
| sort - count
Sentinel KQL
W3CIISLog
| where TimeGenerated > ago(24h)
| extend Q = url_decode(csUriQuery)
| where Q matches regex @"(?i)(union\s+(all\s+)?select|or\s+1=1|sleep\(|benchmark\(|information_schema|' or ')"
| summarize Requests = count(), Statuses = make_set(scStatus), Paths = make_set(csUriStem, 10) by cIP
| sort by Requests desc

照合の前にデコードします(urldecode と url_decode)。そうしないとエンコードされたペイロードがすり抜けます。ステータスコードも確認します。インジェクションのペイロードに対する 200 は、403 より重要です。

SharePoint や OneDrive からのファイルの大量ダウンロード

クラウドT1530
Splunk SPL
index=o365 sourcetype=o365:management:activity Workload IN (SharePoint, OneDrive) Operation=FileDownloaded earliest=-24h
| bin _time span=1h
| stats dc(ObjectId) AS files values(ClientIP) AS ips by _time, UserId
| where files > 100
| sort - files
Sentinel KQL
OfficeActivity
| where TimeGenerated > ago(24h)
| where OfficeWorkload in ("SharePoint", "OneDrive") and Operation == "FileDownloaded"
| summarize Files = dcount(OfficeObjectId), IPs = make_set(ClientIP, 10) by UserId, bin(TimeGenerated, 1h)
| where Files > 100
| sort by Files desc

SPL では stats の前に別の bin コマンドで時間をバケット化しますが、KQL では summarize ... by 句の中に bin() を書きます。

不審な受信トレイルールの作成(転送、削除、移動)

クラウドT1564.008
Splunk SPL
index=o365 sourcetype=o365:management:activity Workload=Exchange (Operation=New-InboxRule OR Operation=Set-InboxRule OR Operation=UpdateInboxRules)
| search Parameters{}.Name IN (DeleteMessage, MoveToFolder, ForwardTo, RedirectTo, ForwardAsAttachmentTo)
| table _time, UserId, ClientIP, Operation, Parameters{}.Name, Parameters{}.Value
Sentinel KQL
OfficeActivity
| where OfficeWorkload == "Exchange"
| where Operation in~ ("New-InboxRule", "Set-InboxRule", "UpdateInboxRules")
| where Parameters has_any ("DeleteMessage", "MoveToFolder", "ForwardTo", "RedirectTo", "ForwardAsAttachmentTo")
| project TimeGenerated, UserId, ClientIP, Operation, Parameters

Splunk はルールのパラメーターを複数値の Parameters{}.Name/Value フィールドとして公開しますが、OfficeActivity は JSON 文字列として保存しており、has_any で検索したり parse_json で展開したりできます。

面接官はSIEMのクエリ思考をどう試すか

完璧なクエリを記憶から書かせるSOC面接はほとんどありません。試されるのはクエリで考える力です。正しいイベントに絞り込み、集計して外れ値を見つけ、結果が怪しい理由、または怪しくない理由を説明できるか。チームがSplunkでもMicrosoft Sentinelでも、SOCアナリスト面接で出るSplunkクエリと、それに相当するKQLでは、同じ3つのパターンが繰り返し登場します。

1. ログオン失敗の絞り込み

「直近1時間のブルートフォースをどう見つけますか?」面接官が聞きたいのは、Event ID 4625 で絞り込み、送信元IPでグループ化し、試行回数と異なるユーザー名の数を数え、しきい値を設定することです。1人のユーザーへの多数の試行はパスワード推測、多数のユーザーへの1回ずつの試行はパスワードスプレーです。そのうえで、次に何を結合するかを伝えます。同じIPからの 4624 です。

送信元別のログオン失敗(SPL)
index=wineventlog EventCode=4625 earliest=-1h
| stats count dc(user) AS users BY src_ip
| where count > 20
| sort - count
送信元別のログオン失敗(KQL)
SecurityEvent
| where TimeGenerated > ago(1h) and EventID == 4625
| summarize count(), users = dcount(TargetUserName) by IpAddress
| where count_ > 20
| order by count_ desc

面接官が突いてくるSplunkとKQLの細かな構文の違いに注意しましょう。stats … BY は summarize … by に、dc() は dcount() になり、KQLではカウント列の名前が count_ になります。

2. 不審な親子プロセスの発見

2番目の定番は「OfficeがPowerShellを起動したことをどう検知しますか?」です。プロセス作成イベント(4688 またはSysmon 1、Microsoft Defenderでは DeviceProcessEvents)を、親が winword.exe、excel.exe、outlook.exe で、子が powershell.exe、cmd.exe、wscript.exe、mshta.exe のものに絞り込みます。そして、親子関係こそがシグナルだと説明します。PowerShell単体は正常ですが、Wordから起動され、コマンドラインに -enc が付いたPowerShellは正常ではありません。上の「シェルやスクリプトホストを起動する Office アプリケーション」と「まれな親子プロセスの組み合わせ」のハントで、両方のバージョンを確認できます。

3. 誤検知のチューニング

L2寄りの面接では「このルールは1日300回発報します。どうしますか?」と聞かれます。強い回答は、単に無効化することを避けます。ヒットをホスト、ユーザー、プロセスでグループ化してノイズ源を特定し、それが良性であること(バックアップエージェント、脆弱性スキャナー、古いパスワードが残ったサービスアカウントなど)を確認したうえで、NOT src_ip IN (…) や where Account !in (…) のような限定的な除外を追加し、理由を記録して見直し日を設定します。このプロセスを説明できるかどうかが、SOC業務で使えるMicrosoft Sentinel KQLクエリと、コピペした構文との違いです。

本物のようなデータで考え方を練習するには、ログの重複取り込みによる誤検知ミッションをSOCシミュレーターで解き、フィールド名の確認用にWindows Event IDチートシートを開いておきましょう。

さらに深く

SIEM:Splunk & KQLモジュールでは、ブルートフォースとImpossible travelのハントを順を追って解説しています。その後、Impossible travelミッションで、VPNと攻撃者を見分けられるか試しましょう。

よくある質問

SOC面接に向けて学ぶのはSplunk SPLとKQLのどちらがよいですか?

志望企業が使っているほうを学び、概念は両方で押さえましょう。インドのサービス企業の多くは顧客向けにSplunkやQRadarを運用し、Microsoft中心の企業はSentinelとDefender(KQL)を使います。絞り込み、集計、ベースラインとの比較という考え方は共通です。

Splunkのstats count byに相当するKQLは何ですか?

summarize count() by field です。KQLではカウント列の名前が count_ になるため、並べ替えは order by count_ desc で行います。

KQLは大文字と小文字を区別しますか?

テーブル名、列名、== 演算子は大文字と小文字を区別します。=~、has、contains は区別しません。SPLのフィールド値は、search では一般に区別しませんが、where では区別します。

Splunkのフィールド名が例と違うのはなぜですか?

フィールド名はアドオンとsourcetypeによって異なります。例はSplunk Add-on for Microsoft Windowsで正規化されたフィールド(user や src_ip など)を前提としています。生のXML形式のWindowsイベントでは TargetUserName や IpAddress のような名前になります。