logstash可以将几条相似的行合并为一行吗?

时间:2016-08-01 11:12:29

标签: logstash

以下是我在kafka服务器的json输入中的内容:

{"deviceName":"device1", "counter":125}
{"deviceName":"device1", "counter":125}
{"deviceName":"device2", "counter":88}
{"deviceName":"device1", "counter":125}
{"deviceName":"device2", "counter":88}
{"deviceName":"device1", "counter":125}
{"deviceName":"device3", "counter":999}
{"deviceName":"device3", "counter":999}

我想在输出中得到它:

{"deviceName":"device1", "counter":125, "nbOfTimes":4}
{"deviceName":"device2", "counter":88, "nbOfTimes":2}
{"deviceName":"device3", "counter":999, "nbOfTimes":2}

使用logstash可以做到这一点吗?如果是,那怎么可能? 我看到了多选项,我认为它不能为我做到这一点。

谢谢你,

此致

0 个答案:

没有答案