mirror of
https://github.com/elastic/kibana.git
synced 2025-04-25 02:09:32 -04:00
Fix data stream API when event.ingested is null (#135817)
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
This commit is contained in:
parent
5a266b7c59
commit
f15355a36f
1 changed files with 5 additions and 7 deletions
|
@ -24,10 +24,7 @@ export async function getDataStreamsQueryMetadata({
|
||||||
esClient.search({
|
esClient.search({
|
||||||
size: 1,
|
size: 1,
|
||||||
index: dataStreamName,
|
index: dataStreamName,
|
||||||
sort: {
|
sort: 'event.ingested:desc',
|
||||||
// @ts-expect-error Type '{ 'event.ingested': string; }' is not assignable to type 'string | string[] | undefined'.
|
|
||||||
'event.ingested': 'desc',
|
|
||||||
},
|
|
||||||
_source: false,
|
_source: false,
|
||||||
fields: ['event.ingested'],
|
fields: ['event.ingested'],
|
||||||
}),
|
}),
|
||||||
|
@ -55,9 +52,10 @@ export async function getDataStreamsQueryMetadata({
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const maxIngested = new Date(
|
const maxIngested =
|
||||||
maxEventIngestedResponse.hits.hits[0]?.fields!['event.ingested']
|
maxEventIngestedResponse.hits.hits[0]?.fields !== undefined
|
||||||
).getTime();
|
? new Date(maxEventIngestedResponse.hits.hits[0].fields['event.ingested']).getTime()
|
||||||
|
: undefined;
|
||||||
|
|
||||||
const namespace = namespaceResponse.terms[0] ?? '';
|
const namespace = namespaceResponse.terms[0] ?? '';
|
||||||
const dataset = datasetResponse.terms[0] ?? '';
|
const dataset = datasetResponse.terms[0] ?? '';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue