Skip to content

Commit

Permalink
Collapse on sha256 field instead of common_name.
Browse files Browse the repository at this point in the history
  • Loading branch information
justinkambic committed Apr 10, 2020
1 parent dd262be commit fe01cf7
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions x-pack/plugins/uptime/server/lib/requests/get_certs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,25 @@ export const getCerts: UMElasticsearchQueryFn<GetCertsParams, Cert[]> = async ({
field: 'tls',
},
},
{
range: {
'@timestamp': {
gte: 'now-1d',
},
},
},
],
},
},
_source: [
'tls.common_name',
'tls.sh256',
'tls.sha256',
'tls.issued_by',
'tls.certificate_not_valid_before',
'tls.certificate_not_valid_after',
],
collapse: {
field: 'tls.common_name',
field: 'tls.sha256',
inner_hits: {
_source: {
includes: ['monitor.id', 'monitor.name'],
Expand Down

0 comments on commit fe01cf7

Please sign in to comment.