0

有一个恶意域/URL 的外部列表,我想定期搜索日志,但有一个明显的问题:

let abuse_domain = (externaldata(sentinel_domain: string )
[@"https://managedsentinel.com/downloads/covid19_domains.txt"]
with (format="txt"))
| where sentinel_domain !startswith "#"
| project sentinel_domain;
abuse_domain
| join 
(
DeviceNetworkEvents
| where Timestamp > ago(1h) 
) on $left.sentinel_domain == $right.RemoteUrl
| project Timestamp,DeviceName,RemoteUrl,DeviceId,ReportId

On 子句不会起作用,因为这两个项目永远不会完全匹配。当 $left.sentinel_domain 是 $rightRemoteUrl 的子字符串时,如何获得匹配?

4

1 回答 1

0

首先尝试使用从 RemoteUrlparse_url中提取域 ( )。Host

像这样:

let abuse_domain = (externaldata(sentinel_domain: string )
[@"https://managedsentinel.com/downloads/covid19_domains.txt"]
with (format="txt"))
| where sentinel_domain !startswith "#"
| project sentinel_domain;
abuse_domain
| join 
(
DeviceNetworkEvents
| where Timestamp > ago(1h)
| extend Host = tostring(parse_url(RemoteUrl).Host)
) on $left.sentinel_domain == $right.Host
| project Timestamp,DeviceName,RemoteUrl,DeviceId,ReportId
于 2020-12-18T16:15:22.133 回答