elk kibana表分组计数

mspsb9vt  于 2021-06-13  发布在  ElasticSearch
关注(0)|答案(0)|浏览(268)

我有一些数据:

{"groupname":"ZAAH", "dname":"DEVICE1", "status":"OK"}

{"groupname":"ZAAH","dname":"DEVICE2", "status":"ERROR"}

{"groupname":"ZAAH","dname":"DEVICE3", "status":"OK"}
{"groupname":"ZAAH","dname":"DEVICE3", "status":"ERROR"}

{"groupname":"ZAAH","dname":"DEVICE4", "status":"ERROR"}
{"groupname":"ZAAH","dname":"DEVICE4", "status":"OK"}

我如何使用let say kibana表来获得这个结果(status ok高于error,因此如果一个设备发送2 status ok and error/or error and ok,我们就认为该设备是正常的):

groupname   status   count
ZAAH        OK       3 (because device1 is OK + device3 is OK + device4 is OK)
ZAAH        ERROR    1 (because device2 is ERROR)

欢迎任何提示。

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题