如何在弹性搜索v8,x,x中获得总观察人数



我计划获得在elkversion 8.x.x,上运行的弹性搜索集群中创建的观察者总数

我尝试点击下面的Watcher统计API,它给了我下面的响应

观察者统计端点

https://elk_endpoint/_watcher/stats

响应

{
"_nodes": {
"total": 3,
"successful": 3,
"failed": 0
},
"cluster_name": "elk_cluster",
"manually_stopped": false,
"stats": [
{
"node_id": "yBj29GluSn2kX8FIm5myFQ",
"watcher_state": "started",
"watch_count": 0,
"execution_thread_pool": {
"queue_size": 0,
"max_size": 50
}
},
{
"node_id": "wUBFDu21Tb6nZETG7C4jsA",
"watcher_state": "started",
"watch_count": 0,
"execution_thread_pool": {
"queue_size": 0,
"max_size": 50
}
},
{
"node_id": "riLkqmfQTU2fbfzsmqxzDw",
"watcher_state": "started",
"watch_count": 67,
"execution_thread_pool": {
"queue_size": 0,
"max_size": 50
}
}
]
}

但当我点击API观察者列表时,观察者数量显示的远不止以上。

为了获得观察者总数,我将对Watcher stats API中所有节点的观察者总数进行汇总。

我在一个表中显示UI上的观察者,我指的是Watcher stats API返回的计数,但我需要索引上存在的所有观察者。

如果有什么方法可以让我得到所有观察者的总数,无论他们的状态如何,请帮帮我?

注意:在UI表中,行数为117,这是List Watch API返回的所有观察者的总数,但由于观察者统计数仅显示69(68+1(,因此表中仅显示69条记录。

流程

我们有一个LIST pojo,它的模式由LIST Watch API 返回

{
"count":117,
"watches": {
....
}
}

这个计数作为一个模态对象发送,显示在表的UI中,但对于只有69条记录,我们正在获取详细信息(根据观察者统计数据迭代行(,其余行为空。

Tldr

手表的搜索api怎么样?

GET /_watcher/_query/watches
{
"count": <total number of watches>,
.
.
.
}

最新更新