iLogtail SPL 使用 where 子句配合 regexp_like 函数实现日志过滤,替代原生的 processor_filter_regex_native 或扩展的 processor_filter_regex 插件。例如,要过滤出 method 为 POST 或 PUT 且 status 为 200 的日志,SPL 语句为:| where regexp_like(method, '^(POST|PUT)$') and regexp_like(status, '^200$')。对于更复杂的过滤条件,如同时包含 Include 和 Exclude 规则,SPL 语句为:| where regexp_like(ip, '10\\..*') and regexp_like(method, 'POST') and not regexp_like(browser, 'aliyun.*')。where 子句支持 and、or、not 等逻辑运算符,结合 regexp_like 可以灵活实现各种正则匹配条件的组合过滤。




