我可能不理解 riemann/clojure 中的一些关键概念。我正在尝试从格式的事件解析字段:服务"aaa:1234.bbbb.cccc.ddddd"
,并使用函数“with”将新字段 pid 添加到事件中。任何人都可以向我解释为什么这段代码riemann.config
会引发异常:
...
(let [index (default :ttl 300 (update-index (index)))]
; Inbound events will be passed to these streams:
(streams
index
(where (service #"(\w+):(\d+)\.(\w+)\.(\w+)\.(\w+)")
(with :pid (str/replace service #"(\w+):(\d+)\.(\w+)\.(\w+)\.(\w+)" "$2")
)
)
...
user=> (riemann.bin/reload!)
#error {
:cause "Unable to resolve symbol: service in this context"
:via
[{:type clojure.lang.Compiler$CompilerException
:message "java.lang.RuntimeException: Unable to resolve symbol: service in this context, compiling:(/etc/riemann/riemann.config:73:19)"