-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
78 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
x-pack/legacy/plugins/siem/server/lib/source_status/query.dsl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
const SERVICE_NAME = 'service.name'; | ||
|
||
export const buildQuery = ({ defaultIndex }: { defaultIndex: string[] }) => { | ||
return { | ||
allowNoIndices: true, | ||
index: defaultIndex, | ||
ignoreUnavailable: true, | ||
terminate_after: 1, | ||
body: { | ||
size: 0, | ||
aggs: { | ||
total_service_names: { | ||
cardinality: { | ||
field: SERVICE_NAME, | ||
}, | ||
}, | ||
}, | ||
}, | ||
track_total_hits: false, | ||
}; | ||
}; |
11 changes: 11 additions & 0 deletions
11
x-pack/legacy/plugins/siem/server/lib/source_status/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
export interface ApmServiceNameAgg { | ||
total_service_names: { | ||
value: number; | ||
}; | ||
} |