我計劃獲取在 elkversion 8.xx 上運行的 elasticsearch 集群中創建的觀察者總數,
我試圖點擊下面的 Watchers stats 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 時,觀察者數量顯示的比上面更多。
為了獲得觀察者總數,我總結了觀察者統計 API 中所有節點的觀察者計數。
我在一個表中顯示 UI 上的觀察者,我指的是觀察者統計 API 回傳的計數,但我需要索引上存在的所有觀察者。
如果我可以得到所有觀察者的總數,無論他們的狀態如何,請幫助我?
注意:在 UI 表中,行數為 117,這是 List Watch API 回傳的所有觀察者的總計數,但由于觀察者統計計數僅顯示 69 (68 1),因此表僅顯示 69 條記錄。
程序
我們有一個 LIST pojo,它的模式由 List Watch API 回傳
{
"count":117,
"watches": {
....
}
}
此計數作為模式物件發送以在表的 UI 中顯示,但只有 69 條記錄,我們獲取詳細資訊(根據觀察者統計計數迭代行),其余行為空。
uj5u.com熱心網友回復:
特長;
手表的搜索 api怎么樣?
GET /_watcher/_query/watches
{
"count": <total number of watches>,
.
.
.
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/514331.html
標籤:弹性搜索弹性搜索观察者
上一篇:將帥無能,累死三軍。
下一篇:如何重新索引和更改_type
