mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 01:38:56 -04:00
[Infra] Fix hosts total count query (#212749)
Fixes [#212745](https://github.com/elastic/kibana/issues/212745) ## Summary Fix for the hosts total count query, which was not correctly filtering hosts from system integration and APM <img width="584" alt="image" src="https://github.com/user-attachments/assets/05c3b244-3a0f-425a-82db-3498c1a6dbb7" /> ### How to test - Connect Kibana to an edge cluster - Navigate to Infrastructure > Hosts - The total number of items on the table should be equal to the number in the hosts count KPI Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
dfe542bd8e
commit
8e5b8580f4
1 changed files with 15 additions and 2 deletions
|
@ -25,8 +25,14 @@ export async function getHostsCount({
|
|||
}) {
|
||||
assertQueryStructure(query);
|
||||
|
||||
const apmDocumentSources = await apmDataAccessServices?.getDocumentSources({
|
||||
start: from,
|
||||
end: to,
|
||||
});
|
||||
|
||||
const documentsFilter = await getDocumentsFilter({
|
||||
apmDataAccessServices,
|
||||
apmDocumentSources,
|
||||
from,
|
||||
to,
|
||||
});
|
||||
|
@ -37,8 +43,15 @@ export async function getHostsCount({
|
|||
track_total_hits: false,
|
||||
query: {
|
||||
bool: {
|
||||
filter: [query, ...rangeQuery(from, to)],
|
||||
should: [...documentsFilter],
|
||||
filter: [
|
||||
query,
|
||||
...rangeQuery(from, to),
|
||||
{
|
||||
bool: {
|
||||
should: [...documentsFilter],
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
aggs: {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue