【发布时间】:2017-11-16 19:06:16
【问题描述】:
我可能不理解 riemann/clojure 中的一些关键概念。
我正在尝试从格式为"aaa:1234.bbbb.cccc.ddddd" 的事件解析字段:service,并使用函数“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)"
【问题讨论】: