我正在努力从 Sentinel 的 extraextensions 列中提取电子邮件地址。我找到了一个在 calculator 中完美运行的正则表达式,提取冒号 (:) 到分号之后的所有内容,后跟分号 (;s)。但是,它在 Kusto 中不起作用,我怀疑是因为它使用了回溯?
下面是在计算器中运行的正则表达式:
(?<=:).*(?=;s)
这是来自其中一个日志的数据:
cat=EXFILTRATION;帐户=O365:[email protected] ;开始=1659975196000;结束=165997519600
使用计算器时,它返回以下内容:
但是,当尝试在 Kusto 中使用它时,它会返回原始数据。有谁能想出一种在 KQL 中实现这一目标的方法吗?
最佳答案
extracting everything after a colon (:) up to a semicolon followed by the latter s (;s).
您不必使用正则表达式。
例如,使用 parse
operator :
print input = 'cat=EXFILTRATION;account=O365:<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="62070f030b0e4c0306061007111122160711164c0d10054c1709" rel="noreferrer noopener nofollow">[email protected]</a>;start=1659975196000;end=165997519600'
| parse input with * ":" email_address ";s" *
关于kql - Kusto 查询语言 - 提取两个字符之间的所有内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73298123/