我有如下文件:
Type 1 (stats from component A) -
_sources {
"@version": "1",
"@timestamp": "2015-11-02T06:50:11.170Z",
"stat_type": 1,
"ConnectionCount": 1,
"ReceivedCount": 2,
"AcceptedCount": 0,
"host": "my-pc",
"component_type": "A",
}
Type 2 (Stats from component B) -
_sources {
"@version": "1",
"@timestamp": "2015-11-02T06:50:11.170Z",
"stat_type": 1,
"SuccessCount": 2,
"host": "my-pc",
"component_type": "B",
}
从这两种类型的文档中,我想做以下事情 -
- 如果 doctypeA 的 ReceivedCount 大于 0,则从 doctypeB 获取 SuccessCount。
- 如果它们不匹配,则使用 elastalert 发出警报。
我有弹性搜索和 elastalert 的基本知识。
我试图理解 elasticserach 脚本来查询 elasticsearch,但由于两条记录中的列不同而无法做到。
请指导。