【发布时间】:2019-09-09 23:09:33
【问题描述】:
我有一个像这样的 grok 比赛:
grok{ match => [ “message”, “Duration: %{NUMBER:duration}”, “Speed: %{NUMBER:speed}” ] }
如果它与 grok 模式匹配,我还想将另一个字段添加到捕获的变量中。我知道我可以使用 mutate 插件和 if-else 来添加新字段,但我有太多匹配项,那样会太长。例如,我想捕获给定文本的右侧字段。
"Duration: 12" => [duration: "12", type: "duration_type"]
"Speed: 12" => [speed: "12", type: "speed_type"]
有没有办法做到这一点?
【问题讨论】: