OTel Contrib连接器路由配置语法错误排查求助
问题定位与修复方案
错误提示明确指出路由语句存在语法问题,核心原因是括号不匹配,具体问题点及修正如下:
错误点梳理
- 第一条路由语句末尾缺失闭合括号
) - 第二条路由语句中
IsMatch函数被多套了一层冗余括号 - 第三条路由语句末尾缺失闭合括号
)
修正后的connectors配置
connectors: routing/logs: default_pipelines: [logs/otlp-all] error_mode: propagate table: - statement: route() where IsMatch(attributes["FileName"],".*access*.log") pipelines: [logs/container, logs/access] - statement: route() where (IsMatch(attributes["FileName"],".*.log") and not IsMatch(attributes["FileName"],".*access*.log") and not IsMatch(attributes["FileName"],".*waf*.log")) pipelines: [logs/container] - statement: route() where IsMatch(attributes["FileName"],".*waf*.log") pipelines: [logs/waf] routing/metrics: default_pipelines: [metrics/1] error_mode: propagate table: - statement: route() where attributes["dataType"] == "type1" pipelines: [metrics/1] - statement: route() where attributes["dataType"] == "type2" pipelines: [metrics/2] - statement: route() where attributes["dataType"] == "type3" pipelines: [metrics/3]
内容的提问来源于stack exchange,提问作者yana_mg
相关产品推荐
相关产品推荐

