2
に新しいフィールドを注入します。 私はフィールド解析しようとしています:フォーマット"aaa:1234.bbbb.cccc.ddddd"
であるイベントからサービスを、そして「と」機能を使用して、イベントに新しいフィールドのPIDを追加します。あなたがwhere
の本体でservice
を使用できない理由である(where* (fn [event] (let [service (:service event)] ,,,)))
ためwhere
マクロによってだけ糖衣構文を、私は(where (service ,,,))
推測私はおそらくリーマン/ Clojureの中にいくつかの重要な概念を理解していないよリーマンイベント
...
(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)"
はい、おかげで、それが動作します: – user8173324
user8173324 @クール!人々はこの問題が解決されていることを知っているので、答えを受け入れてください:) –